X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id DF2EB52824 for ; Tue, 17 May 2005 19:57:36 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 36098-08 for ; Tue, 17 May 2005 22:57:27 +0000 (GMT) Received: from cassarossa.samfundet.no (cassarossa.samfundet.no [129.241.93.19]) by svr1.postgresql.org (Postfix) with ESMTP id B566B5287B for ; Tue, 17 May 2005 19:57:25 -0300 (ADT) Received: from trofast.sesse.net ([129.241.93.32]) by cassarossa.samfundet.no with esmtp (Exim 4.34) id 1DYB0A-0005kY-Io for pgsql-performance@postgresql.org; Wed, 18 May 2005 00:57:27 +0200 Received: from sesse by trofast.sesse.net with local (Exim 3.36 #1 (Debian)) id 1DYB0A-0006N0-00 for ; Wed, 18 May 2005 00:57:26 +0200 Date: Wed, 18 May 2005 00:57:26 +0200 From: "Steinar H. Gunderson" To: pgsql-performance@postgresql.org Subject: Re: Is there any other way to do this? Message-ID: <20050517225726.GA24185@uio.no> Mail-Followup-To: pgsql-performance@postgresql.org References: <428A770C.1030107@kencast.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <428A770C.1030107@kencast.com> X-Operating-System: Linux 2.6.11.8 on a i686 X-Message-Flag: Outlook? --> http://www.mozilla.org/products/thunderbird/ User-Agent: Mutt/1.5.9i X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.015 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200505/309 X-Sequence-Number: 12473 On Tue, May 17, 2005 at 06:58:20PM -0400, Wei Weng wrote: > This time it worked! But VACUUM FULL requires an exclusive lock on the > table which I don't really want to grant. So my question is: why is VACUUM > ANALYZE didn't do the job? Is there any setting I can tweak to make a > VACUUM without granting a exclusive lock? You just didn't vacuum often enough. Plain VACUUM (with ANALYZE or not) only deletes dead rows, it does not reclaim the space used for them (and thus does not compress the remaining ones into fewer pages, so they take less time to scan). If you simply VACUUM regularily (try autovacuum from contrib, it will probably be useful) the problem simply will never be as bad as you describe here, and you won't need to VACUUM FULL. /* Steinar */ -- Homepage: http://www.sesse.net/