Re: Emit fewer vacuum records by reaping removable tuples during pruning

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Jim Nasby <jim(dot)nasby(at)gmail(dot)com>
Cc: Peter Geoghegan <pg(at)bowt(dot)ie>, Melanie Plageman <melanieplageman(at)gmail(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>, Andres Freund <andres(at)anarazel(dot)de>
Subject: Re: Emit fewer vacuum records by reaping removable tuples during pruning
Date: 2024-01-16 21:59:17
Message-ID: CA+Tgmob5Y31KfK8VzD0Eku-Leyuntq49EQQkUcBcH04QYm3nTQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Jan 16, 2024 at 4:28 PM Jim Nasby <jim(dot)nasby(at)gmail(dot)com> wrote:
> On 1/12/24 12:45 PM, Robert Haas wrote:
> > P.P.S. to everyone: Yikes, this logic is really confusing.
>
> Having studied all this code several years ago when it was even simpler
> - it was *still* very hard to grok even back then. I *greatly
> appreciate* the effort that y'all are putting into increasing the
> clarity here.

Thanks. And yeah, I agree.

> BTW, back in the day the whole "no indexes" optimization was a really
> tiny amount of code... I think it amounted to 2 or 3 if statements. I
> haven't yet attempted to grok this patchset, but I'm definitely
> wondering how much it's worth continuing to optimize that case. Clearly
> it'd be very expensive to memoize dead tuples just to trawl that list a
> single time to clean the heap, but outside of that I'm not sure other
> optimazations are worth it given the amount of code
> complexity/duplication they seem to require - especially for code where
> correctness is so crucial.

Personally, I don't think throwing away that optimization is the way
to go. The idea isn't intrinsically complicated, I believe. It's just
that the code has become messy because of too many hands touching it.
At least, that's my read.

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Melanie Plageman 2024-01-16 23:07:24 Re: Emit fewer vacuum records by reaping removable tuples during pruning
Previous Message Jim Nasby 2024-01-16 21:58:42 Re: index prefetching