Re: rowcount for all tables - Mailing list pgsql-sql

From Bruno Wolff III
Subject Re: rowcount for all tables
Date
Msg-id 20060319045652.GA14031@wolff.to
Whole thread Raw
In response to rowcount for all tables  (Stefan Meyer <st.meyer@mdsi.de>)
List 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 by date:

Previous
From: Jeff Frost
Date:
Subject: Re: update before drop causes OID problems in transaction?
Next
From: Svenne Krap
Date:
Subject: How to call table returning function with other table