Reimplement free-space-map management as per recent discussions.
Tom Lane <tgl@sss.pgh.pa.us>
Reimplement free-space-map management as per recent discussions. Adjustable threshold is gone in favor of keeping track of total requested page storage and doling out proportional fractions to each relation (with a minimum amount per relation, and some quantization of the results to avoid thrashing with small changes in page counts). Provide special- case code for indexes so as not to waste space storing useless page free space counts. Restructure internal data storage to be a flat array instead of list-of-chunks; this may cost a little more work in data copying when reorganizing, but allows binary search to be used during lookup_fsm_page_entry().
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/runtime.sgml | modified | +9 −5 |
| src/backend/access/nbtree/nbtpage.c | modified | +2 −7 |
| src/backend/access/nbtree/nbtree.c | modified | +9 −20 |
| src/backend/commands/vacuum.c | modified | +33 −9 |
| src/backend/commands/vacuumlazy.c | modified | +28 −19 |
| src/backend/storage/freespace/freespace.c | modified | +998 −604 |
| src/backend/storage/smgr/smgr.c | modified | +2 −2 |
| src/backend/utils/misc/guc.c | modified | +3 −3 |
| src/backend/utils/misc/postgresql.conf.sample | modified | +3 −2 |
| src/include/storage/freespace.h | modified | +15 −7 |