Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 42667640E23 for ; Mon, 15 Mar 2010 11:43:02 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 50067-04 for ; Mon, 15 Mar 2010 14:42:51 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.187]) by mail.postgresql.org (Postfix) with ESMTP id 99B3C63E9E9 for ; Mon, 15 Mar 2010 11:42:51 -0300 (ADT) Received: from [192.168.0.105] (pool-96-244-14-10.bltmmd.fios.verizon.net [96.244.14.10]) by mrelayeu.kundenserver.de (node=mrbap1) with ESMTP (Nemesis) id 0LoKJV-1NBpDG2uz3-00g9jQ; Mon, 15 Mar 2010 15:42:44 +0100 Message-ID: <4B9E4762.7060703@2ndquadrant.com> Date: Mon, 15 Mar 2010 10:42:42 -0400 From: Greg Smith User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: VJK CC: pgsql-performance@postgresql.org Subject: Re: Deleting bytea, autovacuum, and 8.2/8.4 differences References: <20100313211742.GC2178@comppasch2> <600ad6df1003141822u297522dbvf1f7187d0eee803@mail.gmail.com> <600ad6df1003150654if287c53k301f5763e95a3540@mail.gmail.com> In-Reply-To: <600ad6df1003150654if287c53k301f5763e95a3540@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V01U2FsdGVkX18Cd3XTIVbO4nnCiZp0EHyS0ZwEeO0FIkPfwEM 8WqqmwUhBrprvWYf92zwDLM0lzRpvkgN1oD6h1n5Z+QlIj32HE BOxF3pAEqcqswDoL0kn/vwtqw1diQq6 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.599 tagged_above=-10 required=5 tests=BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 201003/143 X-Sequence-Number: 37968 VJK wrote: > Since Pg does not use the concept of rollback segments, it is unclear > why deletion produces so much disk IO (4GB). With PostgreSQL's write-ahead log, MVCC and related commit log, and transactional DDL features, there's actually even more overhead that can be involved than a simple rollback segment design when you delete things: http://www.postgresql.org/docs/current/static/wal.html http://www.postgresql.org/docs/current/static/mvcc-intro.html http://wiki.postgresql.org/wiki/Hint_Bits http://wiki.postgresql.org/wiki/Transactional_DDL_in_PostgreSQL:_A_Competitive_Analysis One fun thing to try here is to increase shared_buffers and checkpoint_segments, then see if the total number of writes go down. The defaults for both are really low, which makes buffer page writes that might otherwise get combined as local memory changes instead get pushed constantly to disk. -- Greg Smith 2ndQuadrant US Baltimore, MD PostgreSQL Training, Services and Support greg@2ndQuadrant.com www.2ndQuadrant.us