pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: hubert depesz lubaczewski <depesz@gmail.com>
To: Cestmir Hybl <cestmirl@freeside.sk>
Cc: pgsql-performance@postgresql.org
Subject: Re: count(*) using index scan in "query often, update rarely" environment
Date: Fri, 7 Oct 2005 11:54:23 +0200
Message-ID: <9e4684ce0510070254v67e08bcfhb725715803a5de25@mail.gmail.com> (raw)
In-Reply-To: <935801c5cb20$dcf93a00$131fc39e@stratos>
References: <935801c5cb20$dcf93a00$131fc39e@stratos>

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

view thread (11+ messages)  latest in thread

Message-ID: <9e4684ce0510070254v67e08bcfhb725715803a5de25@mail.gmail.com>
Permalink:  ../9e4684ce0510070254v67e08bcfhb725715803a5de25@mail.gmail.com/
Also on:    postgresql.org/message-id/9e4684ce0510070254v67e08bcfhb725715803a5de25@mail.gmail.com

 · 

reply

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-performance@postgresql.org
  Cc: depesz@gmail.com, cestmirl@freeside.sk
  Subject: Re: count(*) using index scan in "query often, update rarely" environment
  In-Reply-To: <9e4684ce0510070254v67e08bcfhb725715803a5de25@mail.gmail.com>
  References: <935801c5cb20$dcf93a00$131fc39e@stratos> <9e4684ce0510070254v67e08bcfhb725715803a5de25@mail.gmail.com>

* 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