X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id D81D69DCA6F for ; Thu, 23 Feb 2006 19:49:17 -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 96353-02 for ; Thu, 23 Feb 2006 19:49:20 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from noel.decibel.org (noel.decibel.org [67.100.216.10]) by postgresql.org (Postfix) with ESMTP id A2F0F9DCA16 for ; Thu, 23 Feb 2006 19:49:15 -0400 (AST) Received: by noel.decibel.org (Postfix, from userid 1001) id 85EAC56428; Thu, 23 Feb 2006 17:49:46 -0600 (CST) Received: (hashcash-sendmail, from uid 1001); Thu, 23 Feb 2006 17:49:45 -0600 Date: Thu, 23 Feb 2006 17:49:45 -0600 From: "Jim C. Nasby" To: Robin Iddon Cc: pgsql-admin@postgresql.org Subject: Re: 8.0.3 pg_autovacuum doesn't clear out stats table? Message-ID: <20060223234945.GN2068@pervasive.com> References: <43FD7312.5080701@edesix.com> <43FDF046.2050609@zeut.net> <43FDFF9A.90603@edesix.com> <43FE0723.3070608@edesix.com> <26139.1140730764@sss.pgh.pa.us> <43FE467E.9090204@edesix.com> <43FE48EF.4000409@edesix.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <43FE48EF.4000409@edesix.com> X-Operating-System: FreeBSD 6.0-RELEASE-p4 amd64 X-Distributed: Join the Effort! http://www.distributed.net User-Agent: Mutt/1.5.11 X-Hashcash: 1:20:060223:robin@edesix.com::V+Vjmsw1ke8mG43k:00uHN X-Hashcash: 1:20:060223:pgsql-admin@postgresql.org::eO/WBYB+dAZ2OXoG:00000000000 0000000000000000000000007Mj+ X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.104 required=5 tests=[AWL=0.104] X-Spam-Score: 0.104 X-Spam-Level: X-Archive-Number: 200602/303 X-Sequence-Number: 20724 On Thu, Feb 23, 2006 at 11:44:47PM +0000, Robin Iddon wrote: > > > > >In fact I just noticed that the number of stats tuples just climbed > >from 1236 to 2634. The ins/del counts are still zero. I ran analyze > >and the update counter went up only by 1232. For pg_autovacuum to > >vacuum this table I need (2*2634)+1000 = 6268 updates, which is never > >going to happen. > > At least not before the number of tuples has climbed to beyond that > count based on my experience to date! I think you're confusing tuples and rows. Everytime you update a row, you create a new tuple. As you've seen, every time you run analyze, ~1400 rows are being updated, which means 1400 new tuples. So as long as pg_autovacuum stays running long enough, it will notice that pg_statistics needs to be vacuumed. Note that it's critical that pg_autovac stay running; it keeps the counts of how many tuples every table has in memory, so if it gets shutdown before enough updates accumulate, the count re-starts from scratch. I'm not certain if the builtin vacuum in 8.1 solves that problem or not. -- Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com Pervasive Software http://pervasive.com work: 512-231-6117 vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461