Re: Temporary tables versus wraparound... again

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Greg Stark <stark(at)mit(dot)edu>
Cc: Andres Freund <andres(at)anarazel(dot)de>, Justin Pryzby <pryzby(at)telsasoft(dot)com>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, 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>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Temporary tables versus wraparound... again
Date: 2023-04-13 16:44:43
Message-ID: CA+Tgmobs1oLugpKw+RL6bHAucRu=APDg5BrNhjiYKVpdvNxzLA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Apr 12, 2023 at 4:23 PM Greg Stark <stark(at)mit(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2023-04-13 17:01:07 Re: Temporary tables versus wraparound... again
Previous Message Daniel Gustafsson 2023-04-13 16:42:51 Re: [PATCH] Add `verify-system` sslmode to use system CA pool for server cert