Re: count(*) slow on large tables

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: count(*) slow on large tables
Дата
Msg-id 19444.1065289898@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: count(*) slow on large tables  (Bruce Momjian <pgman@candle.pha.pa.us>)
Ответы Re: count(*) slow on large tables  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-performance
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Tom Lane wrote:
>> ... and it would give the wrong answers.  Unless the cache is somehow
>> snapshot-aware, so that it can know which other transactions should be
>> included in your count.

> The cache is an ordinary table, with xid's on every row.  I meant it
> would require no index/heap scans of the large table --- it would still
> require a scan of the "count" table.

Oh, that idea.  Yeah, I think we had concluded it might work.  You'd
better make the TODO item link to that discussion, because there's sure
been plenty of discussion of ideas that wouldn't work.

            regards, tom lane

В списке pgsql-performance по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: count(*) slow on large tables
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: count(*) slow on large tables