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

From Richard Huxton
Subject Re: count(*) using index scan in "query often, update rarely"
Date
Msg-id 434681F5.6000906@archonet.com
Whole thread Raw
In response to Re: count(*) using index scan in "query often, update rarely" environment  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-performance
Tom Lane wrote:
>
> There's a workable-looking design in the archives (pghackers probably)
> for maintaining overall table counts in a separate table, with each
> transaction adding one row of "delta" information just before it
> commits.  I haven't seen anything else that looks remotely attractive.

It might be useful if there was a way to trap certain queries and
rewrite/replace them. That way more complex queries could be
transparently redirected to a summary table etc. I'm guessing that the
overhead to check every query would quickly destroy any gains though.

--
   Richard Huxton
   Archonet Ltd

pgsql-performance by date:

Previous
From: "Merlin Moncure"
Date:
Subject: Re: count(*) using index scan in "query often, update rarely" environment
Next
From: Chris Browne
Date:
Subject: Re: Status of Opteron vs Xeon