Re: use AV worker items infrastructure for GIN pending list's cleanup

From: Jaime Casanova <jcasanov(at)systemguards(dot)com(dot)ec>
To: Joel Jacobson <joel(at)compiler(dot)org>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: use AV worker items infrastructure for GIN pending list's cleanup
Date: 2021-05-15 06:42:12
Message-ID: 20210515064212.GA10315@ahch-to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, May 15, 2021 at 08:12:51AM +0200, Joel Jacobson wrote:
> On Mon, Apr 5, 2021, at 16:47, Jaime Casanova wrote:
> > On Mon, Apr 05, 2021 at 10:41:22AM -0300, Euler Taveira wrote:
> > > On Mon, Apr 5, 2021, at 3:31 AM, Jaime Casanova wrote:
> > > > When AV worker items where introduced 4 years ago, i was suggested that
> > > > it could be used for other things like cleaning the pending list of GIN
> > > > index when it reaches gin_pending_list_limit instead of making user
> > > > visible operation pay the price.
> > > >
> > > > That never happened though. So, here is a little patch for that.
> > > >
> > > > Should I add an entry for this on next commitfest?
> > > +1. It slipped through the cracks along the years. It is even suggested in the
> > > current docs since the fast update support.
> > >
> > > https://www.postgresql.org/docs/current/gin-tips.html
> > >
> >
> > Interesting, that comment maybe needs to be rewritten. I would go for
> > remove completely the first paragraph under gin_pending_list_limit entry
>
> Thanks for working on this patch.
>
> I found this thread searching for "gin_pending_list_limit" in pg hackers after reading an interesting article found via the front page of Hacker News: "Debugging random slow writes in PostgreSQL" (https://iamsafts.com/posts/postgres-gin-performance/).
>
> I thought it could be interesting to read about a real user story where this patch would be helpful.
>

A customer here has 20+ GIN indexes in a big heavily used table and
every time one of the indexes reaches gin_pending_list_limit (because of
an insert or update) a user feels the impact.

So, currently we have a cronjob running periodically and checking
pending list sizes to process the index before the limit get fired by an
user operation. While the index still is processed and locked the fact
that doesn't happen in the user face make the process less notorious and
in the mind of users faster.

This will provide the same facility, the process will happen "in the
background".

--
Jaime Casanova
Director de Servicios Profesionales
SystemGuards - Consultores de PostgreSQL

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Joel Jacobson 2021-05-15 06:51:46 Re: use AV worker items infrastructure for GIN pending list's cleanup
Previous Message Fabien COELHO 2021-05-15 06:41:27 Re: seawasp failing, maybe in glibc allocator