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

From Tom Lane
Subject Re: Seqscan in MAX(index_column)
Date
Msg-id 27375.1062732744@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:
> Tom Lane wrote:
>> 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(*).

> With MVCC allowing multiple rows with only one visible, I thought the
> INSERT/DELETE system would work --- once the delete becomes visible, the
> change becomes visible.

Oh, you're imagining the cache as being a row in an ordinary table?
I doubt that could work.  Multiple transactions trying to update these
rows would suffer from contention and deadlock problems, wouldn't they?
        regards, tom lane


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Seqscan in MAX(index_column)
Next
From: Bruce Momjian
Date:
Subject: Re: Seqscan in MAX(index_column)