Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 18C281337BBB for ; Fri, 25 Mar 2011 16:44:13 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 30046-06 for ; Fri, 25 Mar 2011 19:44:03 +0000 (UTC) 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 mail.postgresql.org (Postfix) with ESMTP id BEB771337B49 for ; Fri, 25 Mar 2011 16:44:01 -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 p2PJhwwl015330; Fri, 25 Mar 2011 15:43:58 -0400 (EDT) To: Alvaro Herrera cc: Christopher Browne , Maxim Boguk , pgsql-bugs Subject: Re: BUG #5946: Long exclusive lock taken by vacuum (not full) In-reply-to: <1301080686-sup-7539@alvh.no-ip.org> References: <201103250856.p2P8ufGc004544@wwwmaster.postgresql.org> <4345.1301066239@sss.pgh.pa.us> <13556.1301069421@sss.pgh.pa.us> <1301080686-sup-7539@alvh.no-ip.org> Comments: In-reply-to Alvaro Herrera message dated "Fri, 25 Mar 2011 16:26:33 -0300" Date: Fri, 25 Mar 2011 15:43:58 -0400 Message-ID: <15329.1301082238@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201103/339 X-Sequence-Number: 29849 Alvaro Herrera writes: > What happened to the idea of preallocating tables to a size defined by > the user at CREATE TABLE time, and extending it in chunks instead of a > block at a time, with the idea of reducing fragmentation? Was it > rejected, or just not implemented? I don't recall any particular discussion of making the user contend with that. My thought would be to do something like enlarging the table by 10% anytime we need to extend it. The main issue here is where to cause that to happen. An individual backend that just wants to store one more tuple probably shouldn't have to do that much work. > The other possibly useful idea was to let this truncate step to be run > as a separate activity, without having to complete a vacuum cycle on the > table. Yeah. I did think of a small problem with just letting autovac get blown off the lock: it will fail to send the stats messages about what it's done, which will likely result in a near-immediate launch of a new autovacuum against the table. It'd be better to complete the autovacuum and then try to do the truncation in an independent transaction. regards, tom lane