Repair old performance bug in tuplesort.c/logtape.c. In the case where
Tom Lane <tgl@sss.pgh.pa.us>
Repair old performance bug in tuplesort.c/logtape.c. In the case where we are doing the final merge pass on-the-fly, and not writing the data back onto a 'tape', the number of free blocks in the tape set will become large, leading to a lot of time wasted in ltsReleaseBlock(). There is really no need to track the free blocks anymore in this state, so add a simple shutoff switch. Per report from Stefan Kaltenbrunner.
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/utils/sort/logtape.c | modified | +28 −1 |
| src/backend/utils/sort/tuplesort.c | modified | +35 −15 |
| src/include/utils/logtape.h | modified | +2 −1 |