On 2017-03-22 10:14:14 -0400, Tom Lane wrote:
> Andres Freund <andres@anarazel.de> writes:
> > I propose that for each pg_class entry we start to keep the following
> > additional metadata:
> > - CATALOG_VERSION_NO at relation creation
> > - PG_VERSION_NUM at relation creation
> > - CATALOG_VERSION_NO at last full scan by vacuum
> > - PG_VERSION_NUM at last full scan by vacuum
>
> (1) It's very very hard for me to believe that we need *two* versions of
> the version number. Pick one.
PG_VERSION_NUM is probably enough, alright.
> (2) How you gonna update this in vacuum? It cannot do a transactional
> update.
I think we can just do that in a separate transaction, at the tail end
of vacuum_rel() - if we crash just before that, not that much is lost.
That requires to hand up whether the whole table is scanned, which'd not
be entirely pretty. Alternatively we could "just" PROC_IN_VACUUM* in
lazy_vacuum_rel(), but that seems like a cure worse than the disease.
Greetings,
Andres Freund