Re: [PATCHES] GIN improvements - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [PATCHES] GIN improvements
Date
Msg-id 16562.1216829136@sss.pgh.pa.us
Whole thread Raw
In response to Re: [PATCHES] GIN improvements  (Teodor Sigaev <teodor@sigaev.ru>)
List pgsql-hackers
I wrote:
>> Yeah, I was going to complain about that next :-).  Autovacuum isn't
>> going to trigger as a result of INSERT operations; somehow we have
>> to teach it what to do for GIN indexes.  I remember we discussed this
>> at PGCon but I don't think we decided exactly what to do...

One simple idea is to call aminsertcleanup (probably renamed to
something else like amanalyzehook) during ANALYZE.  This seems a bit
grotty, but it has the very attractive property that we don't need to
give the autovacuum control logic any special knowledge about GIN
indexes.  Either inserts or updates will lead it to trigger either
auto-ANALYZE or auto-VACUUM, and either way GIN gets a cleanup
opportunity.

A possible argument against this is that if we later fix things so
that VACUUM and ANALYZE can happen concurrently on the same table,
amanalyzehook could get called concurrently with ambulkdelete or
other vacuum-support operations.  So the AM author would have to
take care to interlock that safely.  But this doesn't seem like
a big deal to me --- interlocks against regular inserts/updates
are probably a harder problem anyway.

Thoughts?
        regards, tom lane


pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Review: DTrace probes (merged version)
Next
From: "Sushant Sinha"
Date:
Subject: Re: [GENERAL] Fragments in tsearch2 headline