Re: Column correlation drifts, index ignored again - Mailing list pgsql-performance

From Josh Berkus
Subject Re: Column correlation drifts, index ignored again
Date
Msg-id 200402221105.57068.josh@agliodbs.com
Whole thread Raw
In response to Column correlation drifts, index ignored again  (John Siracusa <siracusa@mindspring.com>)
Responses Re: Column correlation drifts, index ignored again
List pgsql-performance
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

pgsql-performance by date:

Previous
From: Josh Berkus
Date:
Subject: Re: JOIN order, 15K, 15K, 7MM rows
Next
From: John Siracusa
Date:
Subject: Re: Column correlation drifts, index ignored again