Re: Slow count(*) again...

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: Slow count(*) again...
Дата
Msg-id AANLkTimQcMKPVDuHgQC11COJ9_ad6zY1dwXtqMj8LxKq@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Slow count(*) again...  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-performance
On Tue, Oct 12, 2010 at 1:07 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Anyway, if anyone is hot to make COUNT(*) faster, that's where to look.
> I don't think any of the previous discussion in this thread is on-point
> at all, except for the parts where people suggested avoiding it.

I kind of hope that index-only scans help with this, too.  If you have
a wide table and a narrow (but not partial) index, and if the
visibility map bits are mostly set, it ought to be cheaper to read the
index than the table - certainly in the case where any disk I/O is
involved, and maybe even if it isn't.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: How does PG know if data is in memory?
Следующее
От: Neil Whelchel
Дата:
Сообщение: Re: Slow count(*) again...