Re: rowcount for all tables

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: rowcount for all tables
Дата
Msg-id 20060319045652.GA14031@wolff.to
обсуждение исходный текст
Ответ на rowcount for all tables  (Stefan Meyer <st.meyer@mdsi.de>)
Список pgsql-sql
On Fri, Mar 17, 2006 at 14:39:04 +0100, Stefan Meyer <st.meyer@mdsi.de> wrote:
> i have a beginner question and i have read the FAQs.
> is there a faster ways than
> 
>     select count(*) from foo;
> 
> to get the rowcount for the tables in my db ?

There are some ways to get approximate counts that won't require scanning
the whole table.

If you are going to be doing lots of these, you can use triggers to
maintain a count. There is also a more complicated approach that can be
used to reduce contention. You should be able to find more details in
the archives.


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

Предыдущее
От: Jeff Frost
Дата:
Сообщение: Re: update before drop causes OID problems in transaction?
Следующее
От: Svenne Krap
Дата:
Сообщение: How to call table returning function with other table