Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id CD05E65044B for ; Wed, 23 Jul 2008 13:47:50 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 98957-01-2 for ; Wed, 23 Jul 2008 13:47:40 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id D6BD965053B for ; Wed, 23 Jul 2008 13:05:38 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id m6NG5aY1016563; Wed, 23 Jul 2008 12:05:37 -0400 (EDT) To: Teodor Sigaev cc: Oleg Bartunov , Alvaro Herrera , Pgsql Hackers Subject: Re: [PATCHES] GIN improvements 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> Comments: In-reply-to Teodor Sigaev message dated "Wed, 23 Jul 2008 17:39:49 +0400" Date: Wed, 23 Jul 2008 12:05:36 -0400 Message-ID: <16562.1216829136@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200807/1076 X-Sequence-Number: 121336 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