Re: Temporary tables versus wraparound... again

From: Andres Freund <andres(at)anarazel(dot)de>
To: Greg Stark <stark(at)mit(dot)edu>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Noah Misch <noah(at)leadboat(dot)com>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Temporary tables versus wraparound... again
Date: 2022-12-06 20:18:42
Message-ID: 20221206201842.y2p4y7pz3tdfzqly@awork3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2022-12-06 14:50:34 -0500, Greg Stark wrote:
> On Tue, 6 Dec 2022 at 13:59, Andres Freund <andres(at)anarazel(dot)de> wrote:
> > On 2022-12-06 13:47:39 -0500, Greg Stark wrote:
> > > So.... I talked about this patch with Ronan Dunklau and he had a good
> > > question.... Why are we maintaining relfrozenxid and relminmxid in
> > > pg_class for temporary tables at all? Autovacuum can't use them and
> > > other sessions won't care about them. The only session that might care
> > > about them is the one attached to the temp schema.
> >
> > Uh, without relfrozenxid for temp tables we can end up truncating clog
> > "ranges" away that are required to access the temp tables. So this would
> > basically mean that temp tables can't be used reliably anymore.
>
> True, we would have to have some other mechanism for exporting the
> frozenxid that the session needs. Presumably that would be something
> in PGProc like the xmin and other numbers. It could be updated by
> scanning our local hash table whenever a transaction starts.

That'd be a fair bit of new mechanism. Not at all impossible, but I'm doubtful
the complexity is worth it. In your patch the relevant catalog change is an
inplace change and thus doesn't cause bloat. And if we have to retain the
clog, I don't see that much benefit in the proposed approach.

> This also probably is what would be needed for multixacts I guess?

Yes.

Greetings,

Andres Freund

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2022-12-06 20:21:09 Re: Error-safe user functions
Previous Message Nathan Bossart 2022-12-06 19:51:08 Re: predefined role(s) for VACUUM and ANALYZE