Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 61FB064FE2B for ; Tue, 2 Dec 2008 08:56:42 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 78928-05 for ; Tue, 2 Dec 2008 08:56:39 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from hook.sigaev.ru (hook.sigaev.ru [212.192.243.50]) by mail.postgresql.org (Postfix) with ESMTP id 5467664FE01 for ; Tue, 2 Dec 2008 08:56:39 -0400 (AST) Received: by hook.sigaev.ru (Postfix, from userid 1003) id DE13F398EF; Tue, 2 Dec 2008 15:56:36 +0300 (MSK) Received: from xor.sai.msu.ru (xor.sai.msu.ru [212.192.243.97]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: teodor) by hook.sigaev.ru (Postfix) with ESMTPSA id B6558398E0; Tue, 2 Dec 2008 15:56:33 +0300 (MSK) Message-ID: <49353081.9030304@sigaev.ru> Date: Tue, 02 Dec 2008 15:56:33 +0300 From: Teodor Sigaev User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.8.1.18) Gecko/20081116 SeaMonkey/1.1.13 MIME-Version: 1.0 To: Heikki Linnakangas CC: Tom Lane , Pgsql Hackers Subject: Re: [PATCHES] GIN improvements References: <483FD205.4090904@sigaev.ru> <486BC501.6060605@sigaev.ru> <27880.1215810535@sss.pgh.pa.us> <487A6E0C.3090600@sigaev.ru> <8993.1216843701@sss.pgh.pa.us> <4888A594.6010102@sigaev.ru> <490B07BA.6030109@sigaev.ru> <492F04D9.5070404@enterprisedb.com> In-Reply-To: <492F04D9.5070404@enterprisedb.com> Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit 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: 200812/66 X-Sequence-Number: 128695 > grovel through. The situation will only be rectified at the next vacuum, > but if there's no deletes or updates on the table, just inserts, > autovacuum won't happen until the next anti-wraparound vacuum. There is not agreement here, see http://archives.postgresql.org/message-id/2818.1216753264@sss.pgh.pa.us > Yet another problem is that if so much work is offloaded to autovacuum, > it can tie up autovacuum workers for a very long time. And the work can > happen on an unfortunate time, when the system is busy, and affect other > queries. There's no vacuum_delay_point()s in gininsertcleanup, so > there's no way to throttle that work. Will insert. > I think we need a hard limit on the number of list pages, before we can > consider accepting this patch. After the limit is full, the next > inserter can flush the list, inserting the tuples in the list into the > tree, or just fall back to regular, slow, inserts. Hard limit is not very good decision - If it will make a flush when limit is reached then sometimes insert or update will take unacceptable amount of time. Small limit is not very helpful, large will takes a lot of time. Although if we calculate limit using work_mem setting then, may be, it will be useful. Bulk insert will collect all pending pages in memory at once. - Falling back to regular insert will take long time for update of whole table - and that was one of reasons of that patch. Users forget to drop GIN index before a global update and query runs forever. -- Teodor Sigaev E-mail: teodor@sigaev.ru WWW: http://www.sigaev.ru/