Re: Row counts/data changes. Any catalog table that has this info?

Поиск
Список
Период
Сортировка
Искать
От
Josh Berkus
Тема
Re: Row counts/data changes. Any catalog table that has this info?
Дата
Msg-id
200402201053.36242.josh@agliodbs.com
Ответ на
Список
Дерево обсуждения
Row counts/data changes. Any catalog table that has this info? "David B" <postgresql@thegatelys.com>
Re: Row counts/data changes. Any catalog table that has this info? Josh Berkus <josh@agliodbs.com>
David,

> table_name    #Rows
> cust          1000
> order         5000
> order_detail  9500

If you're willing to live with some inaccuracy, do:

SELECT relname, reltuples FROM pg_class
WHERE relkind='r';

This count gets updated when you do a VACUUM, and is seldom 100% accurate; 
however, if you VACUUM regularly it will be within 5-10%.

-- 
-Josh BerkusAglio Database SolutionsSan Francisco


В списке pgsql-sql по дате отправления
От: Tom Lane
Дата:
От: Brian Knox
Дата:
Сообщение: Re: Date Foo.
FAQ