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 6BEE644E683 for ; Mon, 27 Dec 2004 18:52:45 +0000 (GMT) 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 08536-05 for ; Mon, 27 Dec 2004 18:52:30 +0000 (GMT) Received: from mail.deg.cc (mail.deg.cc [64.139.134.201]) by svr1.postgresql.org (Postfix) with ESMTP id C894144E67C for ; Mon, 27 Dec 2004 18:52:29 +0000 (GMT) Received: from deg.cc (kyle.deg.cc [198.70.16.205]) by mail.deg.cc (Postfix) with ESMTP id 5120356630 for ; Mon, 27 Dec 2004 13:52:24 -0500 (EST) Message-ID: <41D059EB.9090201@deg.cc> Date: Mon, 27 Dec 2004 13:52:27 -0500 From: Pallav Kalva User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4.2) Gecko/20040308 X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Wrong Stats and Poor Performance Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.05 tagged_above=0 required=5 tests=FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200412/299 X-Sequence-Number: 9674 Hi Everybody. I have a table in my production database which gets updated regularly and the stats on this table in pg_class are totally wrong. I used to run vacuumdb on the whole database daily once and when i posted the same problem of wrong stats in the pg_class most of them from this list and also from postgres docs suggested me to run the "vacuum analyze" more frequently on this table. I had a setup a cronjob couple of weeks ago to run vacuum analyze every 3 hours on this table and still my stats are totally wrong. This is affecting the performance of the queries running on this table very badly. How can i fix this problem ? or is this the standard postgres behaviour ? Here are the stats from the problem table on my production database relpages | reltuples ----------+------------- 168730 | 2.19598e+06 If i rebuild the same table on dev db and check the stats they are totally different, I was hoping that there would be some difference in the stats from the production db stats but not at this extent, as you can see below there is a huge difference in the stats. relpages | reltuples ----------+----------- 25230 | 341155 Thanks! Pallav