From: Bruno Wolff III <bruno@wolff.to>
To: Stefan Meyer <st.meyer@mdsi.de>
Cc: pgsql-sql@postgresql.org
Subject: Re: rowcount for all tables
Date: Sat, 18 Mar 2006 22:56:52 -0600
Message-ID: <20060319045652.GA14031@wolff.to> (raw)
In-Reply-To: <dvee68$hjj$1@news.hub.org>
References: <dvee68$hjj$1@news.hub.org>
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.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: bruno@wolff.to, st.meyer@mdsi.de
Subject: Re: rowcount for all tables
In-Reply-To: <20060319045652.GA14031@wolff.to>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox