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

From Dave Page
Subject Re: PL/PgSQL for counting all rows in all tables.
Date
Msg-id E7F85A1B5FF8D44C8A1AF6885BC9A0E4306AEB@ratbert.vale-housing.co.uk
Whole thread Raw
In response to PL/PgSQL for counting all rows in all tables.  (David Fetter <david@fetter.org>)
Responses Re: PL/PgSQL for counting all rows in all tables.
List pgsql-hackers

> -----Original Message-----
> From: Robert Treat [mailto:xzilla@users.sourceforge.net]
> Sent: 11 October 2004 22:30
> To: Dave Page
> Cc: pgsql-hackers@postgresql.org
> Subject: Re: [HACKERS] PL/PgSQL for counting all rows in all tables.
>
> How do you handle table growth that makes the reltuples value
> out of whack since the last analyze?  Seems unfortunate that
> people may not realize that the numbers they are looking at
> are incorrect but I don't see much way to avoid it.

Right-click the table object and select 'Count' on the current versions.
Previously, iirc it showed the message 'Refresh table to count' in the
actual count field, so you did a right-click -> Refresh.

> Seems new tables would have that problem too since they would
> default to 1000... do you analyze after table creation?

No. 1000 is below the default threshold, so it'll get counted. If you
lower the threshold, it will say 'not counted' in the actual count
field.

Regards, Dave.


pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Making rpath a bit more flexible
Next
From: "Magnus Hagander"
Date:
Subject: Re: open item: tablespace handing in pg_dump/pg_restore