Re: Slow count(*) again...

Поиск
Список
Период
Сортировка
От Vitalii Tymchyshyn
Тема Re: Slow count(*) again...
Дата
Msg-id 4CB58CF0.4020601@gmail.com
обсуждение исходный текст
Ответ на Re: Slow count(*) again...  (Craig Ringer <craig@postnewspapers.com.au>)
Список pgsql-performance
12.10.10 14:44, Craig Ringer написав(ла):
>
>> in the case where you are doing a count(*) where query and the where is
>> on an indexed column, could the search just look at the index + the
>> visibility mapping rather than doing an sequential search through the
>> table?
>
> Nope, because the visibility map, which is IIRC only one bit per page,
> doesn't record how many tuples there are on the page, or enough
> information about them to determine how many of them are visible to
> the current transaction*.
I'd say it can tell you that your may not recheck given tuple, can't it?
You still have to count all index tuples and recheck the ones that are
uncertain. Does it work in this way? This can help a lot for wide tuples
in table, but with narrow index and mostly read-only data.

Best regards, Vitalii Tymchyshyn

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

Предыдущее
От: Neil Whelchel
Дата:
Сообщение: Re: Slow count(*) again...
Следующее
От: Vitalii Tymchyshyn
Дата:
Сообщение: Re: Slow count(*) again...