Re: Seq Scan

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Seq Scan
Дата
Msg-id 23905.1180732504@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Seq Scan  (Kevin Hunter <hunteke@earlham.edu>)
Ответы Re: Seq Scan
Список pgsql-general
Kevin Hunter <hunteke@earlham.edu> writes:
> At 1:17p -0400 on 01 Jun 2007, Tyler Durden wrote:
>> I find strange that a simple SELECT COUNT(...) is so slow with only
>> 700 000 records.

> The much more knowledgable will correct me, but the abbr. version is
> that it is for data integrity and correctness reasons and the
> inherent way in which the MVCC model works.

The bottom line is that a "correct" implementation (ie, one that fully
respects MVCC behavior) would create enormous overhead, as well as bad
contention bottlenecks for concurrent updates.  It doesn't seem worth it.

If you want a cheap approximate answer, there are a couple of ways to
get one, but SELECT COUNT(*) is not that.

            regards, tom lane

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

Предыдущее
От: Frank Wittig
Дата:
Сообщение: Re: warm standby server stops doingcheckpointsafterawhile
Следующее
От: "Alexander Staubo"
Дата:
Сообщение: Re: Slightly OT.