mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-12-09 08:10:09 +08:00
b0eaa4c51b
Previously, all heaps had FSMs. For very small tables, this means that the FSM took up more space than the heap did. This is wasteful, so now we refrain from creating the FSM for heaps with 4 pages or fewer. If the last known target block has insufficient space, we still try to insert into some other page before giving up and extending the relation, since doing otherwise leads to table bloat. Testing showed that trying every page penalized performance slightly, so we compromise and try every other page. This way, we visit at most two pages. Any pages with wasted free space become visible at next relation extension, so we still control table bloat. As a bonus, directly attempting one or two pages can even be faster than consulting the FSM would have been. Once the FSM is created for a heap we don't remove it even if somebody deletes all the rows from the corresponding relation. We don't think it is a useful optimization as it is quite likely that relation will again grow to the same size. Author: John Naylor, Amit Kapila Reviewed-by: Amit Kapila Tested-by: Mithun C Y Discussion: https://www.postgresql.org/message-id/CAJVSVGWvB13PzpbLEecFuGFc5V2fsO736BsdTakPiPAcdMM5tQ@mail.gmail.com |
||
---|---|---|
.. | ||
expected | ||
sql | ||
.gitignore | ||
brinfuncs.c | ||
btreefuncs.c | ||
fsmfuncs.c | ||
ginfuncs.c | ||
hashfuncs.c | ||
heapfuncs.c | ||
Makefile | ||
pageinspect--1.0--1.1.sql | ||
pageinspect--1.1--1.2.sql | ||
pageinspect--1.2--1.3.sql | ||
pageinspect--1.3--1.4.sql | ||
pageinspect--1.4--1.5.sql | ||
pageinspect--1.5--1.6.sql | ||
pageinspect--1.5.sql | ||
pageinspect--1.6--1.7.sql | ||
pageinspect--unpackaged--1.0.sql | ||
pageinspect.control | ||
pageinspect.h | ||
rawpage.c |