]> granicus.if.org Git - postgresql/commit
Change the format of the VM fork to add a second bit per page.
authorRobert Haas <rhaas@postgresql.org>
Wed, 2 Mar 2016 02:49:41 +0000 (21:49 -0500)
committerRobert Haas <rhaas@postgresql.org>
Wed, 2 Mar 2016 02:49:41 +0000 (21:49 -0500)
commita892234f830e832110f63fc0a2afce2fb21d1584
treefbb37cd6dc4e68f450bf5360610756368c90ae46
parent68c521eb92c3515e3306f51a7fd3f32d16c97524
Change the format of the VM fork to add a second bit per page.

The new bit indicates whether every tuple on the page is already frozen.
It is cleared only when the all-visible bit is cleared, and it can be
set only when we vacuum a page and find that every tuple on that page is
both visible to every transaction and in no need of any future
vacuuming.

A future commit will use this new bit to optimize away full-table scans
that would otherwise be triggered by XID wraparound considerations.  A
page which is merely all-visible must still be scanned in that case, but
a page which is all-frozen need not be.  This commit does not attempt
that optimization, although that optimization is the goal here.  It
seems better to get the basic infrastructure in place first.

Per discussion, it's very desirable for pg_upgrade to automatically
migrate existing VM forks from the old format to the new format.  That,
too, will be handled in a follow-on patch.

Masahiko Sawada, reviewed by Kyotaro Horiguchi, Fujii Masao, Amit
Kapila, Simon Riggs, Andres Freund, and others, and substantially
revised by me.
14 files changed:
contrib/pgstattuple/pgstatapprox.c
doc/src/sgml/storage.sgml
src/backend/access/heap/heapam.c
src/backend/access/heap/visibilitymap.c
src/backend/catalog/index.c
src/backend/commands/analyze.c
src/backend/commands/vacuumlazy.c
src/backend/executor/nodeIndexonlyscan.c
src/backend/storage/ipc/standby.c
src/include/access/heapam.h
src/include/access/heapam_xlog.h
src/include/access/visibilitymap.h
src/include/catalog/catversion.h
src/include/storage/bufpage.h