Re: more problems with count(*) on large table - Mailing list pgsql-general

From Gregory Stark
Subject Re: more problems with count(*) on large table
Date
Msg-id 87ir5qkgqr.fsf@oxford.xeocode.com
Whole thread Raw
In response to Re: more problems with count(*) on large table  (Mike Charnoky <noky@nextbus.com>)
Responses Re: more problems with count(*) on large table
List pgsql-general
"Mike Charnoky" <noky@nextbus.com> writes:

> I altered the table in question, with "set statistics 100" on the
> timestamp column, then ran analyze.  This seemed to help somewhat.  Now,
> queries don't seem to hang, but it still takes a long time to do the count:
>  * "where evtime between '2007-09-26' and '2007-09-27'"
>    took 37 minutes to run (result was ~12 million)
>  * "where evtime between '2007-09-25' and '2007-09-26'"
>    took 40 minutes to run (result was ~14 million)
>
> Still stymied about the seemingly random performance, especially since I
> have seen this query execute in 2 minutes.


And the "explain analyze" for these?

Are you still sure it's certain date ranges which are consistently problems
and others are consistently fast? Or could it be something unrelated.

--
  Gregory Stark
  EnterpriseDB          http://www.enterprisedb.com

pgsql-general by date:

Previous
From: Stefan Schwarzer
Date:
Subject: Re: Normalized Tables & SELECT [was: Find "smallest common year"]
Next
From: "Scott Marlowe"
Date:
Subject: Re: usage of indexes for inner joins