pg.ddx.io  pgsql-patches@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Teodor Sigaev <teodor@sigaev.ru>
Cc: Oleg Bartunov <oleg@sai.msu.su>
Cc: Alvaro Herrera <alvherre@commandprompt.com>
Cc: Pgsql Hackers <pgsql-hackers@postgresql.org>
Subject: Re: [PATCHES] GIN improvements
Date: Wed, 23 Jul 2008 12:05:36 -0400
Message-ID: <16562.1216829136@sss.pgh.pa.us> (raw)
In-Reply-To: <488734A5.9030503@sigaev.ru>
References: <483FD205.4090904@sigaev.ru>
	<486BC501.6060605@sigaev.ru>
	<27880.1215810535@sss.pgh.pa.us>
	<487A6E0C.3090600@sigaev.ru>
	<29437.1216742605@sss.pgh.pa.us>
	<48861758.4070507@sigaev.ru>
	<1636.1216749010@sss.pgh.pa.us>
	<488625E8.4070203@sigaev.ru>
	<2818.1216753264@sss.pgh.pa.us>
	<488734A5.9030503@sigaev.ru>

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



view thread (74+ messages)  latest in thread

Message-ID: <16562.1216829136@sss.pgh.pa.us>
Permalink:  ../16562.1216829136@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/16562.1216829136@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-patches@postgresql.org
  Cc: tgl@sss.pgh.pa.us, teodor@sigaev.ru, oleg@sai.msu.su, alvherre@commandprompt.com, pgsql-hackers@postgresql.org
  Subject: Re: [PATCHES] GIN improvements
  In-Reply-To: <16562.1216829136@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox