Re: Emit fewer vacuum records by reaping removable tuples during pruning - Mailing list pgsql-hackers

From Melanie Plageman
Subject Re: Emit fewer vacuum records by reaping removable tuples during pruning
Date
Msg-id CAAKRu_aCYDqz7CyF6nHVbDijLrTCDmO1qucG623-Z6ZjTOQNcQ@mail.gmail.com
Whole thread Raw
In response to Re: Emit fewer vacuum records by reaping removable tuples during pruning  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: Emit fewer vacuum records by reaping removable tuples during pruning
List pgsql-hackers
On Fri, Jan 12, 2024 at 2:47 PM Robert Haas <robertmhaas@gmail.com> wrote:
>
> On Fri, Jan 12, 2024 at 2:43 PM Peter Geoghegan <pg@bowt.ie> wrote:
> > You're using "!prunestate.has_lpdead_items" as part of your test that
> > sets "recordfreespace". But lazy_scan_noprune doesn't get passed a
> > pointer to prunestate, so clearly you'll need to detect the same
> > condition some other way.
>
> OOPS. Thanks.

Also, I think you should combine these in lazy_scan_noprune() now

    /* Save any LP_DEAD items found on the page in dead_items array */
    if (vacrel->nindexes == 0)
    {
        /* Using one-pass strategy (since table has no indexes) */
        if (lpdead_items > 0)
        {

Since we don't set recordfreespace in the outer if statement anymore

And I noticed you missed a reference to recordfreespace output
parameter in the function comment above lazy_scan_noprune().

- Melanie



pgsql-hackers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: Emit fewer vacuum records by reaping removable tuples during pruning
Next
From: Tom Lane
Date:
Subject: Re: Recovering from detoast-related catcache invalidations