Re: count(*) slow on large tables

Поиск
Список
Период
Сортировка
От Christopher Kings-Lynne
Тема Re: count(*) slow on large tables
Дата
Msg-id 3F7E94DC.9090709@familyhealth.com.au
обсуждение исходный текст
Ответ на Re: count(*) slow on large tables  (Jeff <threshar@torgo.978.org>)
Список pgsql-performance
> On our message boards each post is a row.  The powers that be like to know
> how many posts there are total (In addition to 'today')-
> select count(*) from posts is how it has been
> done on our informix db.  With our port to PG I instead select reltuples
> pg_class.

We have exactly the same situation, except we just added a 'num_replies'
field to each thread and a 'num_posts' field to each forum, so that
getting that information out is a very fast operation.  Because, of
course, there are hundreds of times more reads of that information than
writes...

Chris


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

Предыдущее
От: Hannu Krosing
Дата:
Сообщение: Re: [HACKERS] Index/Function organized table layout (from Re:
Следующее
От: Jeff
Дата:
Сообщение: Re: Tuning/performance issue...