From: Andres Freund <andres@anarazel.de>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Allow pg_class xid & multixid horizons to not be set.
Date: Wed, 24 Apr 2019 04:42:20 +0000
Message-ID: <E1hJ9jg-0003nx-QO@gemulon.postgresql.org> (raw)
Allow pg_class xid & multixid horizons to not be set.
This allows table AMs that don't need these horizons. This was already
documented in the tableam relation_set_new_filenode callback, but an
assert prevented if from actually working (the test AM code contained
the change itself). Defang the asserts in the general code, and move
the stronger ones into heap AM.
Relatedly, after CLUSTER/VACUUM, we'd always assign a relfrozenxid /
relminmxid. Change the table_relation_copy_for_cluster() interface to
allow the AM to overwrite the horizons that get set on the pg_class
entry. This'd also in the future allow AMs like heap to compute a
relfrozenxid during rewrite that's the table's actual minimum rather
than a pre-determined value. Arguably it'd have been better to move
the whole computation / setting of those values into the callback, but
it seems likely that for other reasons it'd be better to be able to
use one value to vacuum/cluster multiple tables (e.g. a toast's
horizon shouldn't be different than the table's).
Reported-By: Heikki Linnakangas
Author: Andres Freund
Discussion: https://postgr.es/m/9a7fb9cc-2419-5db7-8840-ddc10c93f122@iki.fi
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/fdc7efcc30b1da950ade72fd35852c21bf8de839
Modified Files
--------------
src/backend/access/heap/heapam_handler.c | 8 ++---
src/backend/access/heap/vacuumlazy.c | 4 +++
src/backend/commands/cluster.c | 24 +++++++++------
src/backend/commands/vacuum.c | 53 +++++++++++++++++++++++---------
src/backend/postmaster/autovacuum.c | 4 +--
src/include/access/tableam.h | 35 ++++++++++++---------
6 files changed, 83 insertions(+), 45 deletions(-)
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: andres@anarazel.de
Subject: Re: pgsql: Allow pg_class xid & multixid horizons to not be set.
In-Reply-To: <E1hJ9jg-0003nx-QO@gemulon.postgresql.org>
References: <E1hJ9jg-0003nx-QO@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