Re: count() in 9.2

Поиск
Список
Период
Сортировка
От Simon Riggs
Тема Re: count() in 9.2
Дата
Msg-id CA+U5nMJuUHGr8Ogbg5+qiTiQgTEogRpjeqH1FK4-50rN4FOOgQ@mail.gmail.com
обсуждение исходный текст
Ответ на count() in 9.2  (Steve Horn <steve@stevehorn.cc>)
Ответы Re: count() in 9.2  (Steve Horn <steve@stevehorn.cc>)
Список pgsql-novice
On 17 October 2012 16:00, Steve Horn <steve@stevehorn.cc> wrote:
> One of the reasons that my team could not take advantage of PostgreSQL was
> due to the poor performance of count(*) aggregate function.
>
> I visited the "Slow Counting" page on the wiki
> (http://wiki.postgresql.org/wiki/Slow_Counting) and it states:
> "Note that the following article only applies to versions of PostgreSQL
> prior to 9.2. Index-only scans are now implemented."
>
> So does this mean that count() is no longer slow? If not, how much faster is
> it? And what does it mean when it says "Index-only scans are now
> implemented."?

I think someone's been drinking the cool-aid...

YMMV but its possible in some cases to get 2-3 times previous
performance on larger, relatively static tables. Not much effect on
smaller, regularly updated tables. Given that most people doing
count() run them either with a WHERE clause or on tables that change
enough you need to re-execute the query, you might not see much in
real usage.

--
 Simon Riggs                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


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

Предыдущее
От: Steve Horn
Дата:
Сообщение: count() in 9.2
Следующее
От: Steve Horn
Дата:
Сообщение: Re: count() in 9.2