postgresql/src/test
Tom Lane f867ce5518 ExecHashRemoveNextSkewBucket must physically copy tuples to main hashtable.
Commit 45f6240a8f added an assumption in ExecHashIncreaseNumBatches
and ExecHashIncreaseNumBuckets that they could find all tuples in the main
hash table by iterating over the "dense storage" introduced by that patch.
However, ExecHashRemoveNextSkewBucket continued its old practice of simply
re-linking deleted skew tuples into the main table's hashchains.  Hence,
such tuples got lost during any subsequent increase in nbatch or nbuckets,
and would never get joined, as reported in bug #13908 from Seth P.

I (tgl) think that the aforesaid commit has got multiple design issues
and should be reworked rather completely; but there is no time for that
right now, so band-aid the problem by making ExecHashRemoveNextSkewBucket
physically copy deleted skew tuples into the "dense storage" arena.

The added test case is able to exhibit the problem by means of fooling the
planner with a WHERE condition that it will underestimate the selectivity
of, causing the initial nbatch estimate to be too small.

Tomas Vondra and Tom Lane.  Thanks to David Johnston for initial
investigation into the bug report.
2016-02-07 12:29:32 -05:00
..
examples Update copyright for 2016 2016-01-02 13:33:40 -05:00
isolation Update copyright for 2016 2016-01-02 13:33:40 -05:00
locale Fix omission of -X (--no-psqlrc) in some psql invocations. 2015-12-28 11:46:43 -05:00
mb Revert "Fix broken multibyte regression tests." 2016-01-26 08:29:15 +09:00
modules Update copyright for 2016 2016-01-02 14:19:48 -05:00
perl PostgresNode: Add names to nodes 2016-01-20 14:13:11 -03:00
regress ExecHashRemoveNextSkewBucket must physically copy tuples to main hashtable. 2016-02-07 12:29:32 -05:00
ssl PostgresNode: Add names to nodes 2016-01-20 14:13:11 -03:00
thread Update copyright for 2016 2016-01-02 13:33:40 -05:00
Makefile Fix up .gitignore and cleanup actions in some src/test/ subdirectories. 2015-04-24 17:13:06 -04:00