Re: Seqscan in MAX(index_column)

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Seqscan in MAX(index_column)
Дата
Msg-id 25643.1062731297@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Seqscan in MAX(index_column)  (Bruce Momjian <pgman@candle.pha.pa.us>)
Ответы Re: Seqscan in MAX(index_column)  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список 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 по дате отправления:

Предыдущее
От: "Matthew T. O'Connor"
Дата:
Сообщение: Re: Another small bug (pg_autovacuum)
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Seqscan in MAX(index_column)