Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 26A807E4443 for ; Fri, 22 Jun 2012 15:04:53 -0300 (ADT) Received: from vexbert.mr-paradox.net ([2001:470:b:28:f::1]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Si8Dy-0001CE-2b for pgsql-performance@postgresql.org; Fri, 22 Jun 2012 18:04:52 +0000 Received: by vexbert.mr-paradox.net (Postfix, from userid 18391) id E00DA84641; Fri, 22 Jun 2012 14:04:36 -0400 (EDT) Date: Fri, 22 Jun 2012 11:04:36 -0700 From: David Kerr To: Tom Lane Cc: pgsql-performance@postgresql.org Subject: Re: Drop statistics? Message-ID: <20120622180436.GB94572@mr-paradox.net> References: <20120622170755.GB93663@mr-paradox.net> <14312.1340386071@sss.pgh.pa.us> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <14312.1340386071@sss.pgh.pa.us> User-Agent: Mutt/1.4.2.3i X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201206/120 X-Sequence-Number: 47146 On Fri, Jun 22, 2012 at 01:27:51PM -0400, Tom Lane wrote: - David Kerr writes: - > I'm trying to work through a root cause on a performance problem. I'd like to - > be able to "show" that a problem was fixed by analyzing the table. - - > what i've done is - > set default_statistics_target=1 - > analyze - - > That gets rid of most of the rows in pg_stats, but i'm still getting decent performance. - - I usually do something like - - DELETE FROM pg_statistic WHERE starelid = 'foo'::regclass; - - (you need to be superuser to be allowed to do this). - - You may need to keep an eye on whether auto-analyze is coming along and - undoing what you did, too. - - regards, tom lane - Awesome, thanks! Dave