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

From: Ian FREISLICH <if(at)hetzner(dot)co(dot)za>
To: "Greg Sabino Mullane" <greg(at)turnstep(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: PL/PgSQL for counting all rows in all tables.
Date: 2004-10-05 08:57:26
Message-ID: E1CEl8Q-0006ut-00@hetzner.co.za
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Browse pgsql-hackers by date

  From Date Subject
Next Message Dave Page 2004-10-05 09:09:47 Re: PL/PgSQL for counting all rows in all tables.
Previous Message Stefan Kaltenbrunner 2004-10-05 06:03:12 Re: -HEAD build failure on OpenBSD 3.6-current/Sparc64