performance of count(*) - Mailing list pgsql-general

From Scott Ribe
Subject performance of count(*)
Date
Msg-id 1962291A-1EE5-4DB4-9A8D-CC4CDE1FE097@elevated-dev.com
Whole thread Raw
Responses Re: performance of count(*)  (Tomas Vondra <tv@fuzzy.cz>)
Re: performance of count(*)  (Andrew Sullivan <ajs@crankycanuck.ca>)
List pgsql-general
I need to optimize queries that deal with some aggregates regarding resource availability. My specific problem is, I
think,very closely analogous to select count(*)... where... 

I know roughly how to do it, aggregated stats table, triggers appending to it, occasional updates to coalesce entries.
I'djust like to see an example to confirm my own plan and see if I'm missing any details. 

I'm sure I've seen references to articles on ways to do this, but all google is getting me is generic complaints about
count(*)performance and suggestions to use stats for estimated total rows in a table, nothing useful for this. 

--
Scott Ribe
scott_ribe@elevated-dev.com
http://www.elevated-dev.com/
(303) 722-0567 voice





pgsql-general by date:

Previous
From: Scott Marlowe
Date:
Subject: Re: Growing a live database
Next
From: Tomas Vondra
Date:
Subject: Re: performance of count(*)