Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 13B64D45792 for ; Tue, 31 Jan 2012 14:44:18 -0400 (AST) Received: from smtp.01.com ([199.36.142.181]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RsIgi-0006yi-Lj for pgsql-performance@postgresql.org; Tue, 31 Jan 2012 18:44:18 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp-out-2.01.com (Postfix) with ESMTP id BC7414F4B38 for ; Tue, 31 Jan 2012 12:44:03 -0600 (CST) X-Virus-Scanned: amavisd-new at smtp-out-2.01.com Received: from smtp.01.com ([127.0.0.1]) by localhost (smtp-out-2.01.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 87rNT94E4mYV for ; Tue, 31 Jan 2012 12:44:03 -0600 (CST) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp-out-2.01.com (Postfix) with ESMTP id 989174F4B3B for ; Tue, 31 Jan 2012 12:44:03 -0600 (CST) Received: from Sidney-Stratton.local (70-36-143-92.dsl.dynamic.sonic.net [70.36.143.92]) by smtp-out-2.01.com (Postfix) with ESMTPSA id 638204F4B38 for ; Tue, 31 Jan 2012 12:44:03 -0600 (CST) Message-ID: <4F283672.1060008@agliodbs.com> Date: Tue, 31 Jan 2012 10:44:02 -0800 From: Josh Berkus Organization: PostgreSQL Experts Inc. User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2.24) Gecko/20111103 Lightning/1.0b2 Thunderbird/3.1.16 MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Re: How to remove a table statistics ? References: In-Reply-To: X-Enigmail-Version: 1.1.1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201201/148 X-Sequence-Number: 46160 On 1/31/12 3:50 AM, Marc Mamin wrote: > Hello, > > I have a weird table, upon with the queries are much faster when no > statics were collected. > > Is there a way to delete statistics information for a table ? > I've tried ALTER.. set STATISTICS 0 and then run ANALYZE, but it seems > that old statistics are kept this way. > Can I delete entries directly in pg_statistic ? > (Postgresql 9.1) You can, but it won't do any good; autovaccum will replace them. It would be better to fix the actual query plan issue. If you can, post the query plans with and without statistics (EXPLAIN ANALYZE, please) here. -- Josh Berkus PostgreSQL Experts Inc. http://pgexperts.com