Re: So, is COUNT(*) fast now?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: So, is COUNT(*) fast now?
Дата
Msg-id 8884.1319296826@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: So, is COUNT(*) fast now?  (Andres Freund <andres@anarazel.de>)
Ответы Re: So, is COUNT(*) fast now?
Список pgsql-hackers
Andres Freund <andres@anarazel.de> writes:
> On Friday, October 21, 2011 08:14:12 PM Robert Haas wrote:
>> On Fri, Oct 21, 2011 at 2:08 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>>> It's not "touching six times less data".  It's touching the exact same
>>> number of tuples either way, just index tuples in one case and heap
>>> tuples in the other.

>> Yeah, but it works out to fewer pages.

> But access to those is not sequential. I guess if you measure cache hit ratios 
> the index scan will come out significantly worse.

Huh?  In the case he's complaining about, the index is all in RAM.
Sequentiality of access is not an issue (at least not at the page
level --- within a page I suppose there could be cache-line effects).
        regards, tom lane


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

Предыдущее
От: Simon Riggs
Дата:
Сообщение: Re: Synchronized snapshots versus multiple databases
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Synchronized snapshots versus multiple databases