Re: Temporary tables versus wraparound... again

From: Andres Freund <andres(at)anarazel(dot)de>
To: Greg Stark <stark(at)mit(dot)edu>
Cc: Peter Geoghegan <pg(at)bowt(dot)ie>, Robert Haas <robertmhaas(at)gmail(dot)com>, 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-14 17:47:32
Message-ID: 20230414174732.aloxvm75gc3imnju@awork3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2023-04-14 10:05:08 -0400, Greg Stark wrote:
> On Thu, 13 Apr 2023 at 13:01, Peter Geoghegan <pg(at)bowt(dot)ie> wrote:
> >
> > On Thu, Apr 13, 2023 at 9:45 AM Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> > >
> > > On Wed, Apr 12, 2023 at 4:23 PM Greg Stark <stark(at)mit(dot)edu> wrote:
> > > > 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.

If rel is *not NULL*, the horizon is more recent - that seems correct?

> > You can make arguments for either way of restating it being clearer
> > than the other.
>
> Yeah, I think Robert is being confused by the implicit double
> negative. If we don't know which relation it is it's because relation
> is NULL and the comment is talking about if it's "not NULL". I think
> you're right that it would be less confusing if it just says "if you
> pass NULL we have to give a conservative result which means an older
> xid and fewer removable tuples".
>
> But I'm saying the parenthetical part is not just confusing, it's
> outright wrong. I guess that just means the first half was so
> confusing it confused not only the reader but the author too.

I don't think it's outright wrong, but it is very confusing what it relates
to. For some reason I tried to "attach" the parenthetical to the "otherwise",
which doesn't make a whole lot of sense. How about:

* If rel is not NULL the horizon may be considerably more recent (i.e.
* allowing more tuples to be removed) than otherwise. In the NULL case a
* horizon that is correct (but not optimal) for all relations will be
* returned. Thus, if possible, a relation should be provided.

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2023-04-14 17:57:15 Re: daitch_mokotoff module
Previous Message Karl O. Pinc 2023-04-14 17:41:23 Re: doc: add missing "id" attributes to extension packaging page