X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id B72F2D1B9EB for ; Sun, 22 Feb 2004 19:08:08 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 37662-04 for ; Sun, 22 Feb 2004 15:08:07 -0400 (AST) Received: from davinci.ethosmedia.com (server228.ethosmedia.com [209.128.84.228]) by svr1.postgresql.org (Postfix) with ESMTP id 21B57D1B9BD for ; Sun, 22 Feb 2004 15:08:06 -0400 (AST) Received: from [63.195.55.98] (HELO spooky) by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) with ESMTP id 4475005; Sun, 22 Feb 2004 11:09:15 -0800 Content-Type: text/plain; charset="iso-8859-1" From: Josh Berkus Organization: Aglio Database Solutions To: John Siracusa , Postgres Performance Subject: Re: Column correlation drifts, index ignored again Date: Sun, 22 Feb 2004 11:05:57 -0800 User-Agent: KMail/1.4.3 References: <94FA2D7A-64CC-11D8-9DEA-000A95BA4506@mindspring.com> In-Reply-To: <94FA2D7A-64CC-11D8-9DEA-000A95BA4506@mindspring.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <200402221105.57068.josh@agliodbs.com> X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200402/250 X-Sequence-Number: 5774 On Saturday 21 February 2004 16:18, John Siracusa wrote: John, > Next, thanks to my earlier thread, I clustered the table on the date > column and then "SET STATISTICS" on the date column to be 100. That > did the trick, and I stopped explicitly disabling seqscan. 100? Are you sure you don't mean some other number? 100 is not very high for problem analyze issues. You might try 500. Generally when I have a problem query I raise stats to something like 1000 and drop it down until the problem behaviour starts re-appearing. > date_trunc('day', date) AS date Have you tried putting an index on date_trunc('day', date) and querying on that instead of using this: > date BETWEEN '2004-02-01 00:00:00' AND '2004-02-28 23:59:59' -- Josh Berkus Aglio Database Solutions San Francisco