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 5954B44EB5C for ; Mon, 27 Dec 2004 20:51:48 +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 44419-08 for ; Mon, 27 Dec 2004 20:51:43 +0000 (GMT) Received: from stark.xeocode.com (gsstark.mtl.istop.com [66.11.160.162]) by svr1.postgresql.org (Postfix) with ESMTP id B08B744EBAE for ; Mon, 27 Dec 2004 20:51:43 +0000 (GMT) Received: from localhost ([127.0.0.1] helo=stark.xeocode.com) by stark.xeocode.com with smtp (Exim 3.36 #1 (Debian)) id 1Cj1px-0005I7-00; Mon, 27 Dec 2004 15:51:29 -0500 To: Pallav Kalva Cc: John A Meinel , pgsql-performance@postgresql.org Subject: Re: Wrong Stats and Poor Performance References: <41D059EB.9090201@deg.cc> <41D06223.9060500@arbash-meinel.com> <41D067B9.5080308@deg.cc> In-Reply-To: <41D067B9.5080308@deg.cc> From: Greg Stark Organization: The Emacs Conspiracy; member since 1992 Date: 27 Dec 2004 15:51:29 -0500 Message-ID: <87mzvzbh2m.fsf@stark.xeocode.com> Lines: 21 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.049 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200412/303 X-Sequence-Number: 9678 Pallav Kalva writes: > >> 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 ? If you need it there's nothing wrong with running vacuum even more often than this. As often as every 5 minutes isn't unheard of. You should also look at raising the fsm settings. You need to run vacuum often enough that on average not more tuples are updated in the intervening time than can be kept track of in the fsm settings. So raising the fsm settings allow you to run vacuum less often without having things bloat. There's a way to use the output vacuum verbose gives you to find out what fsm settings you need. But I don't remember which number you should be looking at there offhand. -- greg