From: Cestmir Hybl <cestmirl@freeside.sk>
To: pgsql-performance@postgresql.org
Subject: count(*) using index scan in "query often, update rarely" environment
Date: Fri, 7 Oct 2005 11:24:05 +0200
Message-ID: <935801c5cb20$dcf93a00$131fc39e@stratos> (raw)
Hello all
First of all, I do understand why pgsql with it's MVCC design has to examine tuples to evaluate "count(*)" and "count(*) where (...)" queries in environment with heavy concurrent updates.
This kind of usage IMHO isn't the average one. There are many circumstances with rather "query often, update rarely" character.
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?
(sorry for disturbing if this was already discussed)
Regards,
Cestmir Hybl
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: cestmirl@freeside.sk
Subject: Re: count(*) using index scan in "query often, update rarely" environment
In-Reply-To: <935801c5cb20$dcf93a00$131fc39e@stratos>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox