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

From Steinar H. Gunderson
Subject Re: count(*) using index scan in "query often, update rarely" environment
Date
Msg-id 20051007104816.GA8371@uio.no
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
On Fri, Oct 07, 2005 at 11:24:05AM +0200, Cestmir Hybl 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?

Even if there is no running update, there might still be dead rows in the
table. In any case, of course, a new update could always be occurring while
your counting query was still running.

/* Steinar */
--
Homepage: http://www.sesse.net/

pgsql-performance by date:

Previous
From: "Cestmir Hybl"
Date:
Subject: Re: count(*) using index scan in "query often, update rarely" environment
Next
From: "Cestmir Hybl"
Date:
Subject: Re: count(*) using index scan in "query often, update rarely" environment