X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id A26229DCA22 for ; Wed, 1 Mar 2006 02:45:55 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 13557-04 for ; Wed, 1 Mar 2006 02:45:55 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from wolff.to (wolff.to [66.93.197.194]) by postgresql.org (Postfix) with SMTP id 504389DC9C9 for ; Wed, 1 Mar 2006 02:45:53 -0400 (AST) Received: (qmail 5234 invoked by uid 500); 1 Mar 2006 06:55:56 -0000 Date: Wed, 1 Mar 2006 00:55:56 -0600 From: Bruno Wolff III To: Nik Cc: pgsql-performance@postgresql.org Subject: Re: Large Table With Only a Few Rows Message-ID: <20060301065556.GA1137@wolff.to> Mail-Followup-To: Bruno Wolff III , Nik , pgsql-performance@postgresql.org References: <1141051682.534005.194130@v46g2000cwv.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1141051682.534005.194130@v46g2000cwv.googlegroups.com> User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.099 required=5 tests=[AWL=0.099] X-Spam-Score: 0.099 X-Spam-Level: X-Archive-Number: 200603/1 X-Sequence-Number: 17438 On Mon, Feb 27, 2006 at 06:48:02 -0800, Nik wrote: > I have a table that has only a few records in it at the time, and they > get deleted every few seconds and new records are inserted. Table never > has more than 5-10 records in it. > > However, I noticed a deteriorating performance in deletes and inserts > on it. So I performed vacuum analyze on it three times (twice in a row, > and once two days later). In the statistics it says that the table size > is 863Mb, toast table size is 246Mb, and indexes size is 134Mb, even > though the table has only 5-10 rows in it it. I was wondering how can I > reclaim all this space and improve the performance? You can use VACUUM FULL to recover the space. You should be running normal VACUUMs on that table every minute or two, not once a day.