Fix YA incremental sort bug.
Tom Lane <tgl@sss.pgh.pa.us>
Fix YA incremental sort bug. switchToPresortedPrefixMode() did the wrong thing if it detected a batch boundary just at the last tuple of a fullsort group. The initially-reported symptom was a "retrieved too many tuples in a bounded sort" error, but the test case added here just silently gives the wrong answer without this patch. I (tgl) am not really happy about committing this patch without review from the incremental-sort authors, but they seem AWOL and we are hard against a release deadline. This does demonstrably make some cases better, anyway. Per bug #16846 from Yoran Heling. Back-patch to v13 where incremental sort was introduced. Neil Chen Discussion: https://postgr.es/m/16846-ae49f51ac379a4cb@postgresql.org
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/executor/nodeIncrementalSort.c | modified | +7 −0 |
| src/test/regress/expected/incremental_sort.out | modified | +11 −0 |
| src/test/regress/sql/incremental_sort.sql | modified | +3 −0 |
Discussion
- BUG #16846: "retrieved too many tuples in a bounded sort" 12 messages · 2021-01-31 → 2021-02-15