Re: maintenance_work_mem used by Vacuum - Mailing list pgsql-hackers

From Amit Kapila
Subject Re: maintenance_work_mem used by Vacuum
Date
Msg-id CAA4eK1Jw2-OsKCJ7x+VRrtr3OcV_PnytKEvb4Ciznb8yJvpgOg@mail.gmail.com
Whole thread Raw
In response to Re: maintenance_work_mem used by Vacuum  (Greg Stark <stark@mit.edu>)
List pgsql-hackers
On Thu, Oct 17, 2019 at 6:07 AM Greg Stark <stark@mit.edu> wrote:
>
> It's a bit unfortunate that we're doing the pending list flush while the vacuum memory is allocated at all. Is there
anyreason other than the way the callbacks are defined that gin doesn't do the pending list flush before vacuum does
theheap scan and before it allocates any memory using maintenance_work_mem? 
>

I can't think of any other reason.  Can we think of doing it as a
separate phase for indexes?  That can help in containing the memory
usage to a maximum of maintenance_work_mem for Gin indexes, but I am
not sure how useful it is for other index AM's.  Another idea could be
that we do something special (cleanup of pending list) just for Gin
indexes before heap scan in Vacuum.

> (I'm guessing doing it after vacuum is finished would have different problems with tuples in the pending queue not
gettingvacuumed?) 

Yeah, I also think so.

BTW, good point!

--
With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Dilip Kumar
Date:
Subject: Re: Questions/Observations related to Gist vacuum
Next
From: Thomas Munro
Date:
Subject: Re: SegFault on 9.6.14