Re: PL/PgSQL for counting all rows in all tables.

From: Rod Taylor <pg(at)rbt(dot)ca>
To: Robert Treat <xzilla(at)users(dot)sourceforge(dot)net>
Cc: Dave Page <dpage(at)vale-housing(dot)co(dot)uk>, PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PL/PgSQL for counting all rows in all tables.
Date: 2004-10-12 20:33:22
Message-ID: 1097613202.952.148.camel@home
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> BTW The reason I'm asking about this is we're trying to come up with a good
> scheme for phppgadmin to show estimated counts without showing incorrect
> numbers to users... or at least giving them a clue that the numbers might be
> really off.

The vacuum daemon should know how far off the count might be. You can
display 100 +- 15%, where the 100 is collected by ANALYZE and the 15% is
determined based on the vacuum daemon estimation.

Of course, AVD needs to be implemented and the interface created (a
pg_count view?)...

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andreas Pflug 2004-10-12 20:48:36 Re: PL/PgSQL for counting all rows in all tables.
Previous Message Bruce Momjian 2004-10-12 20:33:18 Re: open item: tablespace handing in pg_dump/pg_restore