postgresql/src/backend
Tom Lane 44634e474f Allow child-relation entries to be made in ec_has_const EquivalenceClasses.
This fixes an oversight in commit 11cad29c91,
which introduced MergeAppend plans.  Before that happened, we never
particularly cared about the sort ordering of scans of inheritance child
relations, since appending their outputs together would destroy any
ordering anyway.  But now it's important to be able to match child relation
sort orderings to those of the surrounding query.  The original coding of
add_child_rel_equivalences skipped ec_has_const EquivalenceClasses, on the
originally-correct grounds that adding child expressions to them was
useless.  The effect of this is that when a parent variable is equated to
a constant, we can't recognize that index columns on the equivalent child
variables are not sort-significant; that is, we can't recognize that a
child index on, say, (x, y) is able to generate output in "ORDER BY y"
order when there is a clause "WHERE x = constant".  Adding child
expressions to the (x, constant) EquivalenceClass fixes this, without any
downside that I can see other than a few more planner cycles expended on
such queries.

Per recent gripe from Robert McGehee.  Back-patch to 9.1 where MergeAppend
was introduced.
2012-03-02 14:29:07 -05:00
..
access When a GiST page is split during index build, it might not have a buffer. 2012-03-02 13:16:09 +02:00
bootstrap Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
catalog Remove TOAST table from pg_database 2012-03-01 12:50:52 -03:00
commands ALTER TABLE: skip FK validation when it's safe to do so 2012-02-27 19:10:24 -03:00
executor Make EXPLAIN (BUFFERS) track blocks dirtied, as well as those written. 2012-02-22 20:33:05 -05:00
foreign Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
lib Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
libpq Remove useless cast 2012-02-26 15:31:16 +02:00
main Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
nodes ALTER TABLE: skip FK validation when it's safe to do so 2012-02-27 19:10:24 -03:00
optimizer Allow child-relation entries to be made in ec_has_const EquivalenceClasses. 2012-03-02 14:29:07 -05:00
parser Add COLLATION FOR expression 2012-03-02 21:12:16 +02:00
po Translation updates 2011-08-17 14:07:46 +03:00
port Fix poll() implementation of WaitLatchOrSocket to notice postmaster death. 2012-01-15 22:08:03 +02:00
postmaster Avoid double close of file handle in syslogger on win32 2012-02-21 17:12:25 +01:00
regex Merge dissect() into cdissect() to remove a pile of near-duplicate code. 2012-02-24 18:40:31 -05:00
replication Minor bug fix and cleanup from self-review of sync rep queues patch. 2012-01-30 14:36:17 +00:00
rewrite Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
snowball Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
storage Correctly detect SSI conflicts of prepared transactions after crash. 2012-02-29 15:42:36 +02:00
tcop Run a portal's cleanup hook immediately when pushing it to FAILED state. 2012-02-15 16:19:01 -05:00
tsearch Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
utils Add COLLATION FOR expression 2012-03-02 21:12:16 +02:00
.gitignore Add gitignore for mingw/cygwin build outputs 2011-06-09 18:11:47 +02:00
Makefile Speed up in-memory tuplesorting. 2012-02-15 12:13:32 -05:00
common.mk Call check_keywords.pl in maintainer-check 2012-02-27 13:53:12 +02:00
nls.mk Sort file list when creating gettext-files 2011-12-27 20:20:56 +02:00