Skip site navigation (1) Skip section navigation (2)

Re: Most efficient report of number of records in all tables?

From: "Merlin Moncure" <mmoncure(at)gmail(dot)com>
To: dante(at)lorenso(dot)com
Cc: "Dann Corbit" <DCorbit(at)connx(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Most efficient report of number of records in all tables?
Date: 2007-02-27 02:20:49
Message-ID: b42b73150702261820q686b36edhea875360d1b502ad@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-general
On 2/27/07, D. Dante Lorenso <dante(at)lorenso(dot)com> wrote:
> Dann Corbit wrote:
> > If you only need a cardinality estimate, then pg_class.reltuples may be
> > of help (it will be accurate to when the last vacuum was performed).
> >
>
> Last vacuum ... how does that work with autovacuum?

'analyze' updates pg_class.reltuples also.  It is also cheaper than
vacuum...you can force a fresh one by doing an analyze before you do
your sweep.

merlin

In response to

pgsql-general by date

Next:From: Tom LaneDate: 2007-02-27 02:25:01
Subject: Re: preventing ALTER TABLE RENAME from changing view definitions?
Previous:From: George NychisDate: 2007-02-27 01:48:35
Subject: Re: dropping a master table and all of its partitions?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group