Re: maintenance_work_mem = 64kB doesn't work for vacuum

From: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
To: David Rowley <dgrowleyml(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: maintenance_work_mem = 64kB doesn't work for vacuum
Date: 2025-03-17 16:48:29
Message-ID: CAD21AoBcVZK=cDH9JBJLFQrrjrm7epHx8o+2mzCtiDqbreo+Yw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Mar 10, 2025 at 2:53 AM David Rowley <dgrowleyml(at)gmail(dot)com> wrote:
>
> On Mon, 10 Mar 2025 at 17:22, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)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 Content-Type Size
0001-Fix-assertion-failure-in-parallel-vacuum-with-minima.patch application/octet-stream 5.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jacob Champion 2025-03-17 16:49:17 Re: dblink: Add SCRAM pass-through authentication
Previous Message Bertrand Drouvot 2025-03-17 16:11:27 Re: Draft for basic NUMA observability