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>)
Список pgsql-sql
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
Дата:
Сообщение: Re: Creating constraint sometime fail in a transaction
Следующее
От: Brian Knox
Дата:
Сообщение: Re: Date Foo.