Re: select count(*) from a large table is very slow

Поиск
Список
Период
Сортировка
От Jonah H. Harris
Тема Re: select count(*) from a large table is very slow
Дата
Msg-id 36e682920705180630y2c28cdc5m14af94d6d62e1daf@mail.gmail.com
обсуждение исходный текст
Ответ на Re: select count(*) from a large table is very slow  (Kenneth Marshall <ktm@rice.edu>)
Ответы Re: select count(*) from a large table is very slow  ("Daniel Cristian Cruz" <danielcristian@gmail.com>)
Список pgsql-admin
On 5/18/07, Kenneth Marshall <ktm@rice.edu> wrote:
> Make a summary table and select from there instead.

Yes, a summary table updated by triggers is the only way to have
correct numbers... but you also pay the overhead of maintaining those
numbers on every INSERT/UPDATE statement.  If you just need
*reasonable* guesstimates, use reltuples in pg_class after an analyze.

--
Jonah H. Harris, Software Architect | phone: 732.331.1324
EnterpriseDB Corporation            | fax: 732.331.1301
33 Wood Ave S, 3rd Floor            | jharris@enterprisedb.com
Iselin, New Jersey 08830            | http://www.enterprisedb.com/

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

Предыдущее
От: Jessica Richard
Дата:
Сообщение: cross database references...
Следующее
От: "Daniel Cristian Cruz"
Дата:
Сообщение: Re: select count(*) from a large table is very slow