Re: Temporary tables versus wraparound... again - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Temporary tables versus wraparound... again
Date
Msg-id CA+Tgmobs1oLugpKw+RL6bHAucRu=APDg5BrNhjiYKVpdvNxzLA@mail.gmail.com
Whole thread Raw
In response to Re: Temporary tables versus wraparound... again  (Greg Stark <stark@mit.edu>)
Responses Re: Temporary tables versus wraparound... again  (Peter Geoghegan <pg@bowt.ie>)
List pgsql-hackers
On Wed, Apr 12, 2023 at 4:23 PM Greg Stark <stark@mit.edu> wrote:
> I'm trying to wrap my head around GetOldestNonRemovableTransactionId()
> and whether it's the right thing here. This comment is not helping me:
>
> /*
>  * Return the oldest XID for which deleted tuples must be preserved in the
>  * passed table.
>  *
>  * If rel is not NULL the horizon may be considerably more recent than
>  * otherwise (i.e. fewer tuples will be removable). In the NULL case a horizon
>  * that is correct (but not optimal) for all relations will be returned.
>  *
>  * This is used by VACUUM to decide which deleted tuples must be preserved in
>  * the passed in table.
>  */
>
>
> Am I crazy or is the parenthetical comment there exactly backwards? If
> the horizon is *more recent* then fewer tuples are *non*-removable.
> I.e. *more* tuples are removable, no?

Isn't it the non-parenthetical part that's wrong? I would expect that
if we don't know which relation it is, the horizon might be
considerably LESS recent, which would result in fewer tuples being
removable.

--
Robert Haas
EDB: http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Daniel Gustafsson
Date:
Subject: Re: [PATCH] Add `verify-system` sslmode to use system CA pool for server cert
Next
From: Peter Geoghegan
Date:
Subject: Re: Temporary tables versus wraparound... again