Re: PL/PgSQL for counting all rows in all tables. - Mailing list pgsql-hackers

From Ian FREISLICH
Subject Re: PL/PgSQL for counting all rows in all tables.
Date
Msg-id E1CEl8Q-0006ut-00@hetzner.co.za
Whole thread Raw
In response to Re: PL/PgSQL for counting all rows in all tables.  ("Greg Sabino Mullane" <greg@turnstep.com>)
List pgsql-hackers
"Greg Sabino Mullane" wrote:
> ANALYZE;
>  
> SELECT n.nspname, relname, reltuples
> FROM pg_class c, pg_namespace n
> WHERE c.relnamespace=n.oid
> AND relkind='r'
> AND NOT n.nspname ~ '^pg_'
> ORDER BY 1,2;

Maybe this gem should be passed onto the pgadmin folks.  When you
click on a table name in the interface it does what I can only
presume is a count(*) from relation, which takes forever on enormous
relations.  It then claims this to be a row estimate anyway, so
they could probably drop the analyze.

Ian

--
Ian Freislich


pgsql-hackers by date:

Previous
From: Stefan Kaltenbrunner
Date:
Subject: Re: -HEAD build failure on OpenBSD 3.6-current/Sparc64
Next
From: "Dave Page"
Date:
Subject: Re: PL/PgSQL for counting all rows in all tables.