On Thu, Oct 17, 2019 at 6:07 AM Greg Stark <st...@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 any reason other than the way the 
> callbacks are defined that gin doesn't do the pending list flush before 
> vacuum does the heap 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 getting vacuumed?)

Yeah, I also think so.

BTW, good point!

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


Reply via email to