Re: Seqscan in MAX(index_column) - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Seqscan in MAX(index_column)
Date
Msg-id 25643.1062731297@sss.pgh.pa.us
Whole thread Raw
In response to Re: Seqscan in MAX(index_column)  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: Seqscan in MAX(index_column)  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-hackers
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Neil Conway wrote:
>> In general, I don't think this is worth doing.

> It is possible it isn't worth doing.  Can the INSERT/DELETE
> incrementing/decrementing the cached count work reliabily?

I don't even see how the notion of a single cached value makes
theoretical sense, when in principle every transaction may have
a different idea of the correct answer.

You could doubtless maintain a fairly good approximate total this
way, and that would be highly useful for some applications ...
but it isn't COUNT(*).
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Matthew T. O'Connor"
Date:
Subject: Re: Another small bug (pg_autovacuum)
Next
From: Bruce Momjian
Date:
Subject: Re: Seqscan in MAX(index_column)