Create a routine PageIndexMultiDelete() that replaces a loop around
Tom Lane <tgl@sss.pgh.pa.us>
Create a routine PageIndexMultiDelete() that replaces a loop around PageIndexTupleDelete() with a single pass of compactification --- logic mostly lifted from PageRepairFragmentation. I noticed while profiling that a VACUUM that's cleaning up a whole lot of deleted tuples would spend as much as a third of its CPU time in PageIndexTupleDelete; not too surprising considering the loop method was roughly O(N^2) in the number of tuples involved.
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/access/nbtree/nbtpage.c | modified | +3 −8 |
| src/backend/access/nbtree/nbtxlog.c | modified | +2 −7 |
| src/backend/storage/page/bufpage.c | modified | +137 −3 |
| src/include/storage/bufpage.h | modified | +2 −1 |