postgresql/src
Tom Lane e2c2c2e8b1 Improve planner's handling of duplicated index column expressions.
It's potentially useful for an index to repeat the same indexable column
or expression in multiple index columns, if the columns have different
opclasses.  (If they share opclasses too, the duplicate column is pretty
useless, but nonetheless we've allowed such cases since 9.0.)  However,
the planner failed to cope with this, because createplan.c was relying on
simple equal() matching to figure out which index column each index qual
is intended for.  We do have that information available upstream in
indxpath.c, though, so the fix is to not flatten the multi-level indexquals
list when putting it into an IndexPath.  Then we can rely on the sublist
structure to identify target index columns in createplan.c.  There's a
similar issue for index ORDER BYs (the KNNGIST feature), so introduce a
multi-level-list representation for that too.  This adds a bit more
representational overhead, but we might more or less buy that back by not
having to search for matching index columns anymore in createplan.c;
likewise btcostestimate saves some cycles.

Per bug #6351 from Christian Rudolph.  Likely symptoms include the "btree
index keys must be ordered by attribute" failure shown there, as well as
"operator MMMM is not a member of opfamily NNNN".

Although this is a pre-existing problem that can be demonstrated in 9.0 and
9.1, I'm not going to back-patch it, because the API changes in the planner
seem likely to break things such as index plugins.  The corner cases where
this matters seem too narrow to justify possibly breaking things in a minor
release.
2011-12-23 18:45:14 -05:00
..
backend Improve planner's handling of duplicated index column expressions. 2011-12-23 18:45:14 -05:00
bin Add a security_barrier option for views. 2011-12-22 16:16:31 -05:00
include Improve planner's handling of duplicated index column expressions. 2011-12-23 18:45:14 -05:00
interfaces Don't forget to de-escape the password field in .pgpass. 2011-12-22 13:02:57 -05:00
makefiles Add pg_upgrade test suite 2011-11-27 22:42:32 +02:00
pl PL/Python: One more file renaming fix to unbreak the build 2011-12-18 22:34:53 +02:00
port Enable compiling with the mingw-w64 32 bit compiler. 2011-12-10 15:35:41 -05:00
template Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
test Improve planner's handling of duplicated index column expressions. 2011-12-23 18:45:14 -05:00
timezone Update time zone data files to tzdata release 2011n. 2011-11-30 11:48:05 -05:00
tools Make pgcompinclude/pgrminclude less tied to Bruce's personal machine. 2011-12-01 14:44:32 -05:00
tutorial Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
DEVELOPERS Replace a couple of references to files that no longer exist in the source 2009-05-04 08:08:47 +00:00
Makefile Fix some oversights in distprep and maintainer-clean targets. 2011-03-10 00:04:05 -05:00
Makefile.global.in Make distprep and *clean build targets recurse into all subdirectories. 2011-07-03 13:55:12 -04:00
Makefile.shlib Use single quotes in preference to double quotes for protecting pathnames. 2011-06-15 21:45:23 -04:00
bcc32.mak Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
nls-global.mk Add the possibility to pass --flag arguments to xgettext calls 2011-06-27 00:37:21 +03:00
win32.mak Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00