Re: SELECT count(*) Generating Lots of Write Activity

From: Douglas McNaught <doug(at)mcnaught(dot)org>
To: "Logan Bowers" <logan(at)zillow(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: SELECT count(*) Generating Lots of Write Activity
Date: 2005-08-02 02:24:00
Message-ID: m2y87lkren.fsf@Douglas-McNaughts-Powerbook.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Logan Bowers" <logan(at)zillow(dot)com> writes:

> I'm potentially having a strange performance problem. I have a BIG table:
> ~100M, ~1KB rows. I do a SELECT count(*) from it (I know it will be slow)
> and as I watch procinfo on my DB server I see a huge amount of write
> activity. Thus,

The only thing I can think of is that you have a lot of dirty page
buffers (either in PG's shared buffer area or the kernel's page cache)
due to prior write activity, and they are getting written out to make
room for the sequential scan's incoming buffers.

> 3) Are my tools lying to me (i.e. procinfo is wrong)?

Perhaps; if you're on Linux try 'vmstat' instead of procinfo as a
check.

-Doug

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Gregory Youngblood 2005-08-02 03:55:03 Re: PostgreSQL vs. MySQL
Previous Message Matthew Terenzio 2005-08-02 02:19:15 tsearch2 and colons or urls