Add regression test case exercising the sorting path for hash index build.
Tom Lane <tgl@sss.pgh.pa.us>
Add regression test case exercising the sorting path for hash index build. We've broken this code path at least twice in the past, so it's prudent to have a test case that covers it. To allow exercising the code path without creating a very large (and slow to run) test case, redefine the sort threshold to be bounded by maintenance_work_mem as well as the number of available buffers. While at it, fix an ancient oversight that when building a temp index, the number of available buffers is not NBuffers but NLocBuffer. Also, if assertions are enabled, apply a direct test that the sort actually does return the tuples in the expected order. Peter Geoghegan Patch: <CAM3SWZTBAo4hjbBd780+MrOKiKp_TMo1N3A0Rw9_im8gbD7fQA@mail.gmail.com>
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/access/hash/hash.c | modified | +17 −3 |
| src/backend/access/hash/hashsort.c | modified | +20 −3 |
| src/test/regress/expected/create_index.out | modified | +7 −0 |
| src/test/regress/sql/create_index.sql | modified | +7 −0 |