Skip site navigation (1) Skip section navigation (2)

pgsql: Fix EquivalenceClass code to handle volatile sort expressions in

From: tgl(at)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix EquivalenceClass code to handle volatile sort expressions in
Date: 2007-11-08 21:49:48
Message-ID: 20071108214948.29755754156@cvs.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-committers
Log Message:
-----------
Fix EquivalenceClass code to handle volatile sort expressions in a more
predictable manner; in particular that if you say ORDER BY output-column-ref,
it will in fact sort by that specific column even if there are multiple
syntactic matches.  An example is
	SELECT random() AS a, random() AS b FROM ... ORDER BY b, a;
While the use-case for this might be a bit debatable, it worked as expected
in earlier releases, so we should preserve the behavior for 8.3.  Per my
recent proposal.

While at it, fix convert_subquery_pathkeys() to handle RelabelType stripping
in both directions; it needs this for the same reasons make_sort_from_pathkeys
does.

Modified Files:
--------------
    pgsql/src/backend/nodes:
        outfuncs.c (r1.315 -> r1.316)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/nodes/outfuncs.c?r1=1.315&r2=1.316)
    pgsql/src/backend/optimizer/path:
        equivclass.c (r1.3 -> r1.4)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/path/equivclass.c?r1=1.3&r2=1.4)
        pathkeys.c (r1.88 -> r1.89)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/path/pathkeys.c?r1=1.88&r2=1.89)
    pgsql/src/backend/optimizer/plan:
        createplan.c (r1.233 -> r1.234)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/plan/createplan.c?r1=1.233&r2=1.234)
    pgsql/src/backend/optimizer/util:
        tlist.c (r1.75 -> r1.76)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/util/tlist.c?r1=1.75&r2=1.76)
    pgsql/src/include/nodes:
        relation.h (r1.147 -> r1.148)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/nodes/relation.h?r1=1.147&r2=1.148)
    pgsql/src/include/optimizer:
        paths.h (r1.99 -> r1.100)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/optimizer/paths.h?r1=1.99&r2=1.100)
        tlist.h (r1.46 -> r1.47)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/optimizer/tlist.h?r1=1.46&r2=1.47)

pgsql-committers by date

Next:From: Bruce MomjianDate: 2007-11-08 22:08:18
Subject: pgsql: Add mention of pl/proxy toolset to docs.
Previous:From: User MkzDate: 2007-11-08 21:32:40
Subject: pgbouncer - pgbouncer: jenkins hash: optimize last memcpy compiler

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group