Re: maintenance_work_mem = 64kB doesn't work for vacuum - Mailing list pgsql-hackers

From Masahiko Sawada
Subject Re: maintenance_work_mem = 64kB doesn't work for vacuum
Date
Msg-id CAD21AoBcVZK=cDH9JBJLFQrrjrm7epHx8o+2mzCtiDqbreo+Yw@mail.gmail.com
Whole thread Raw
In response to Re: maintenance_work_mem = 64kB doesn't work for vacuum  (David Rowley <dgrowleyml@gmail.com>)
Responses Re: maintenance_work_mem = 64kB doesn't work for vacuum
List pgsql-hackers
On Mon, Mar 10, 2025 at 2:53 AM David Rowley <dgrowleyml@gmail.com> wrote:
>
> On Mon, 10 Mar 2025 at 17:22, Masahiko Sawada <sawada.mshk@gmail.com> wrote:
> > Regarding that patch, we need to note that the lpdead_items is a
> > counter that is not reset in the entire vacuum. Therefore, with
> > maintenance_work_mem = 64kB, once we collect at least one lpdead item,
> > we perform a cycle of index vacuuming and heap vacuuming for every
> > subsequent block even if they don't have a lpdead item. I think we
> > should use vacrel->dead_items_info->num_items instead.
>
> OK, I didn't study the code enough to realise that. My patch was only
> intended as an indication of what I thought. Please feel free to
> proceed with your own patch using the correct field.
>

I've attached the patch. I added the minimum regression tests for that.

Regards,

--
Masahiko Sawada
Amazon Web Services: https://aws.amazon.com

Attachment

pgsql-hackers by date:

Previous
From: Bertrand Drouvot
Date:
Subject: Re: Draft for basic NUMA observability
Next
From: Jacob Champion
Date:
Subject: Re: dblink: Add SCRAM pass-through authentication