Re: Number of rows in a table

Поиск
Список
Период
Сортировка
От Christopher Browne
Тема Re: Number of rows in a table
Дата
Msg-id 60isoa4l6o.fsf@dev6.int.libertyrms.info
обсуждение исходный текст
Ответ на Re: Number of rows in a table  ("paul butler" <paul@entropia.co.uk>)
Список pgsql-novice
ron.l.johnson@cox.net (Ron Johnson) writes:
> Well yes, but in most other databases, there is a system table that
> stores the approximate number of records in each table, and querying
> that system table is a *lot* faster than sequentially reading a 100M
> row table.

That relation would be pg_class, the domain is called "reltuples."

It is only about as accurate as the last vacuum and/or analyze has
made it, so if you don't fairly regularly vacuum tables, the
approximation may not be very good.  (Which is an argument in favor of
vacuuming fairly often...)
--
select 'cbbrowne' || '@' || 'libertyrms.info';
<http://dev6.int.libertyrms.com/>
Christopher Browne
(416) 646 3304 x124 (land)

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

Предыдущее
От: Luis Hernán Otegui
Дата:
Сообщение: unsubscribe
Следующее
От: "Tyler Colbert"
Дата:
Сообщение: Re: using dates in pgsql