Re: count(*) slow on large tables

Поиск
Список
Период
Сортировка
От Shridhar Daithankar
Тема Re: count(*) slow on large tables
Дата
Msg-id 3F7D172E.3060107@persistent.co.in
обсуждение исходный текст
Ответ на Re: count(*) slow on large tables  (Dror Matalon <dror@zapatec.com>)
Список pgsql-performance
Dror Matalon wrote:

> I smell a religious war in the aii:-).
> Can you go several days in a row without doing select count(*) on any
> of your tables?
>
> I suspect that this is somewhat a domain specific issue. In some areas
> you don't need to know the total number of rows in your tables, in
> others you do.

If I were you, I would have an autovacuum daemon running and rather than doing
select count(*), I would look at stats generated by vacuums. They give
approximate number of tuples and it should be good enough it is accurate within
a percent.

Just another approach of achieving same thing.. Don't be religious about running
a qeury from SQL prompt. That's it..

  Shridhar


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

Предыдущее
От: "Gregory S. Williamson"
Дата:
Сообщение: Re: count(*) slow on large tables
Следующее
От: Andriy Tkachuk
Дата:
Сообщение: Re: runtime of the same query in function differs on 2