Re: count(*) using index scan in "query often, update rarely" environment - Mailing list pgsql-performance

From Cestmir Hybl
Subject Re: count(*) using index scan in "query often, update rarely" environment
Date
Msg-id 9d5b01c5cb27$e7a1c970$131fc39e@stratos
Whole thread Raw
In response to count(*) using index scan in "query often, update rarely" environment  ("Cestmir Hybl" <cestmirl@freeside.sk>)
Responses Re: count(*) using index scan in "query often, update rarely" environment
List pgsql-performance
Yes, I can possibly use triggers to maintanin counts of several fixed groups of records or total recordcount (but it's unpractical).
 
No, I can't speed-up evaluation of generic "count(*) where ()" queries this way.
 
My question was rather about general performance of count() queries in environment with infrequent updates.
 
Cestmir
----- Original Message -----
Sent: Friday, October 07, 2005 11:54 AM
Subject: Re: [PERFORM] count(*) using index scan in "query often, update rarely" environment

On 10/7/05, Cestmir Hybl <cestmirl@freeside.sk> wrote:
Isn't it possible (and reasonable) for these environments to keep track of whether there is a transaction in progress with update to given table and if not, use an index scan (count(*) where) or cached value (count(*)) to perform this kind of query?

if i understand your problem correctly, then simple usage of triggers will do the job just fine.

hubert

pgsql-performance by date:

Previous
From: hubert depesz lubaczewski
Date:
Subject: Re: count(*) using index scan in "query often, update rarely" environment
Next
From: "Steinar H. Gunderson"
Date:
Subject: Re: count(*) using index scan in "query often, update rarely" environment