From: Robert Haas <rhaas@postgresql.org>
To: pgsql-committers@postgresql.org
Subject: pgsql: Change the format of the VM fork to add a second bit per page.
Date: Wed, 02 Mar 2016 02:51:53 +0000
Message-ID: <E1aawtF-0000Tn-G0@gemulon.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>
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.
Branch
------
master
Details
-------
http://git.postgresql.org/pg/commitdiff/a892234f830e832110f63fc0a2afce2fb21d1584
Modified Files
--------------
contrib/pgstattuple/pgstatapprox.c | 2 +-
doc/src/sgml/storage.sgml | 10 +-
src/backend/access/heap/heapam.c | 61 +++++++++-
src/backend/access/heap/visibilitymap.c | 191 ++++++++++++++++++-------------
src/backend/catalog/index.c | 2 +-
src/backend/commands/analyze.c | 8 +-
src/backend/commands/vacuumlazy.c | 103 ++++++++++++++---
src/backend/executor/nodeIndexonlyscan.c | 12 +-
src/backend/storage/ipc/standby.c | 6 +-
src/include/access/heapam.h | 1 +
src/include/access/heapam_xlog.h | 5 +-
src/include/access/visibilitymap.h | 21 +++-
src/include/catalog/catversion.h | 2 +-
src/include/storage/bufpage.h | 11 +-
14 files changed, 309 insertions(+), 126 deletions(-)
--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: rhaas@postgresql.org
Subject: Re: pgsql: Change the format of the VM fork to add a second bit per page.
In-Reply-To: <E1aawtF-0000Tn-G0@gemulon.postgresql.org>
References: <E1aawtF-0000Tn-G0@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox