postgresql/src/backend/utils
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
..
adt Improve planner's handling of duplicated index column expressions. 2011-12-23 18:45:14 -05:00
cache Add a security_barrier option for views. 2011-12-22 16:16:31 -05:00
error Tweak previous patch to ensure edata->filename always gets initialized. 2011-11-30 00:37:06 -05:00
fmgr Further code review for range types patch. 2011-11-20 23:50:27 -05:00
hash Clean up the #include mess a little. 2011-09-04 01:13:16 -04:00
init Cancel running query if it is detected that the connection to the client is 2011-12-09 14:21:36 +02:00
mb Further improvement of make_greater_string. 2011-10-30 12:22:11 -04:00
misc include_if_exists facility for config file. 2011-12-15 19:40:58 -05:00
mmgr Redesign the plancache mechanism for more flexibility and efficiency. 2011-09-16 00:43:52 -04:00
resowner Clean up the #include mess a little. 2011-09-04 01:13:16 -04:00
sort Create a "sort support" interface API for faster sorting. 2011-12-07 00:19:39 -05:00
time Move "hot" members of PGPROC into a separate PGXACT array. 2011-11-25 08:02:10 -05:00
.gitignore Avoid maintaining three separate copies of the error codes list. 2011-02-03 22:32:49 -05:00
errcodes.txt Add GET STACKED DIAGNOSTICS plpgsql command to retrieve exception info. 2011-07-18 14:47:18 -04:00
Gen_dummy_probes.sed Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
Gen_fmgrtab.pl Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
generate-errcodes.pl Avoid maintaining three separate copies of the error codes list. 2011-02-03 22:32:49 -05:00
Makefile Make handling of errcodes.h more consistent with other generated headers. 2011-02-04 09:29:10 -05:00
probes.d Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00