SELECT count(*) Generating Lots of Write Activity - Mailing list pgsql-general

From Logan Bowers
Subject SELECT count(*) Generating Lots of Write Activity
Date
Msg-id 85CE4E3FD2EC2C4E8AAE39916AC1A383069E34D3@ms07.mse2.exchange.ms
Whole thread Raw
Responses Re: SELECT count(*) Generating Lots of Write Activity  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: SELECT count(*) Generating Lots of Write Activity  (Douglas McNaught <doug@mcnaught.org>)
List pgsql-general

Hello,

 

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,

 

1)       Why does this statement generate any writes at all?

2)       Is it possible to tweak something to make it avoid doing so? 

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

 

Thanks! 

 

Oh, and our server configuration is:

Postgres 8.0.1, Linux 2.6, AMD64, 4GB RAM, and 3TB of storage (two RAID5 volumes striped together)

 

 

Logan Bowers

pgsql-general by date:

Previous
From: hisatomo@ctc-g.co.jp
Date:
Subject: could not bind IPv6 socket
Next
From: Tom Lane
Date:
Subject: Re: feeding big script to psql