X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id DDA01D1B4E5 for ; Fri, 30 Jul 2004 09:59:06 -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 11552-10 for ; Fri, 30 Jul 2004 12:59:07 +0000 (GMT) Received: from hetzner.co.za (lfw.hetzner.co.za [196.7.18.226]) by svr1.postgresql.org (Postfix) with ESMTP id 3A90DD1B181 for ; Fri, 30 Jul 2004 09:58:59 -0300 (ADT) Received: from localhost ([127.0.0.1]) by hetzner.co.za with esmtp (Exim 3.36 #1) id 1BqWyT-000Oqe-00; Fri, 30 Jul 2004 14:59:01 +0200 To: pgsql-admin@postgresql.org Cc: Steve From: Ian FREISLICH Subject: Re: please please please PLEASE help! In-Reply-To: Message from "Rob Bamber" of "Thu, 29 Jul 2004 16:38:03 +0100." Date: Fri, 30 Jul 2004 14:59:01 +0200 Message-Id: X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200407/323 X-Sequence-Number: 14391 "Rob Bamber" wrote: > Another thought - > > We had a similar issue recently. Our support guys dropped the > database and then rebuilt it from a dump file. The size of the data > directory went down from 12GB to less than 2GB. According to the sys > ad that did the work postgres is not very good a reclaiming disk space > after large quantities of tuples are deleted over time. And another thought, Have you tried clustering your tables on the most frequently used and/or time-important index in your joins? (remember to VACUUM ANALYZE after the cluster has completed) You might find a huge performance increase. Clustering should also fix the problem mentioned above because the table is physically re-written on disk. Use EXPLAIN ANALYZE to find out which is the most time-consuming part of your query and optimise that. Also, have you analyzed your database recently? If you've never run VACUUM ANALYZE your query planner's statistics have never been updated so the query planner might not be making the best choices. Ian -- Ian Freislich