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

From Martijn van Oosterhout
Subject Re: more problems with count(*) on large table
Date
Msg-id 20071002074719.GB12469@svana.org
Whole thread Raw
In response to Re: more problems with count(*) on large table  (Bill Moran <wmoran@potentialtech.com>)
List pgsql-general
On Mon, Oct 01, 2007 at 01:34:32PM -0400, Bill Moran wrote:
> This sounds like a caching issue.  My guess at what's happening is that
> other operations are pushing this data out of the shared_buffers, so
> when you run it, the system has to pull a bunch of tuples off the disk
> to check them.  If you run it again immediately, the tuples are still in
> memory, and it runs very fast.

You should check your ratio of system cache to shared_buffers. Pushing
things out of shared buffers isn't bad if you've got a much bigger OS
behind it. The cost of pulling something out of the OS cache is
negligable compared to really going to disk.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Attachment

pgsql-general by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: how to ignore invalid byte sequence for encoding without using sql_ascii?
Next
From: Tomasz Ostrowski
Date:
Subject: Re: more problems with count(*) on large table