postgresql/src/test
Tom Lane a4523c5aa5 Improve planning of btree index scans using ScalarArrayOpExpr quals.
Since we taught btree to handle ScalarArrayOpExpr quals natively (commit
9e8da0f757), the planner has always included
ScalarArrayOpExpr quals in index conditions if possible.  However, if the
qual is for a non-first index column, this could result in an inferior plan
because we can no longer take advantage of index ordering (cf. commit
807a40c551).  It can be better to omit the
ScalarArrayOpExpr qual from the index condition and let it be done as a
filter, so that the output doesn't need to get sorted.  Indeed, this is
true for the query introduced as a test case by the latter commit.

To fix, restructure get_index_paths and build_index_paths so that we
consider paths both with and without ScalarArrayOpExpr quals in non-first
index columns.  Redesign the API of build_index_paths so that it reports
what it found, saving useless second or third calls.

Report and patch by Andrew Gierth (though rather heavily modified by me).
Back-patch to 9.2 where this code was introduced, since the issue can
result in significant performance regressions compared to plans produced
by 9.1 and earlier.
2014-10-26 16:12:22 -04:00
..
examples Update copyright for 2014 2014-01-07 16:05:30 -05:00
isolation Implement SKIP LOCKED for row-level locks 2014-10-07 17:23:34 -03:00
locale Rename 'gmake' to 'make' in docs and recommended commands 2014-02-12 17:29:19 -05:00
mb Lots of doc corrections. 2012-04-23 22:43:09 -04:00
performance Run newly-configured perltidy script on Perl files. 2012-07-04 21:47:49 -04:00
perl Fix TAP tests with Perl 5.12 2014-10-26 10:26:36 -04:00
regress Improve planning of btree index scans using ScalarArrayOpExpr quals. 2014-10-26 16:12:22 -04:00
thread Remove dependency on wsock32.lib in favor of ws2_32 2014-07-15 14:18:39 +02:00
Makefile Add isolation test to check-world and installcheck-world 2012-03-05 20:19:20 +02:00