postgresql/src/test/regress
Tom Lane 624e440a47 Improve the heuristic for ordering child paths of a parallel append.
Commit ab7271677 introduced code that attempts to order the child
scans of a Parallel Append node in a way that will minimize execution
time, based on total cost and startup cost.  However, it failed to
think hard about what to do when estimated costs are exactly equal;
a case that's particularly likely to occur when comparing on startup
cost.  In such a case the ordering of the child paths would be left
to the whims of qsort, an algorithm that isn't even stable.

We can improve matters by applying the rule used elsewhere in the
planner: if total costs are equal, sort on startup cost, and
vice versa.  When both cost estimates are exactly equal, rather
than letting qsort do something unpredictable, sort based on the
child paths' relids, which should typically result in sorting in
inheritance order.  (The latter provision requires inventing a
qsort-style comparator for bitmapsets, but maybe we'll have use
for that for other reasons in future.)

This results in a few plan changes in the select_parallel test,
but those all look more reasonable than before, when the actual
underlying cost numbers are taken into account.

Discussion: https://postgr.es/m/4944.1515446989@sss.pgh.pa.us
2018-01-09 13:07:52 -05:00
..
data Improve key representation for GIN jsonb_ops, and fix existence-search bug. 2014-05-09 08:41:26 -04:00
expected Improve the heuristic for ordering child paths of a parallel append. 2018-01-09 13:07:52 -05:00
input Add more tests for reloptions 2017-10-19 14:22:05 +02:00
output Add more tests for reloptions 2017-10-19 14:22:05 +02:00
sql Tweak parallel hash join test case in hopes of improving stability. 2018-01-04 01:06:58 -05:00
.gitignore Update .gitignore for config.cache. 2014-12-18 19:56:42 +09:00
GNUmakefile Update copyright for 2018 2018-01-02 23:30:12 -05:00
Makefile Fix non-GNU makefiles for AIX make. 2017-11-30 00:57:22 -08:00
README Don't generate plain-text HISTORY and src/test/regress/README anymore. 2014-02-10 20:48:04 -05:00
parallel_schedule SQL procedures 2017-11-30 11:03:20 -05:00
pg_regress.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
pg_regress.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
pg_regress_main.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
regress.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
regressplans.sh Rename 'gmake' to 'make' in docs and recommended commands 2014-02-12 17:29:19 -05:00
resultmap Enable compiling with the mingw-w64 32 bit compiler. 2011-12-10 15:35:41 -05:00
serial_schedule SQL procedures 2017-11-30 11:03:20 -05:00
standby_schedule Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00

README

Documentation concerning how to run these regression tests and interpret
the results can be found in the PostgreSQL manual, in the chapter
"Regression Tests".