Re: [HACKERS] Metadata about relation creation & full scans. - Mailing list pgsql-hackers

From Andres Freund
Subject Re: [HACKERS] Metadata about relation creation & full scans.
Date
Msg-id 20170322144356.ygs3pz6oy5qtgu3h@alap3.anarazel.de
Whole thread Raw
In response to Re: [HACKERS] Metadata about relation creation & full scans.  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [HACKERS] Metadata about relation creation & full scans.  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
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



pgsql-hackers by date:

Previous
From: Stephen Frost
Date:
Subject: Re: [HACKERS] increasing the default WAL segment size
Next
From: Dave Page
Date:
Subject: Re: [HACKERS] Monitoring roles patch