Re: table row count

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Martin Hurst" <martinh(at)ix(dot)netcom(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: table row count
Date: 2003-02-09 06:11:45
Message-ID: 23885.1044771105@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Martin Hurst" <martinh(at)ix(dot)netcom(dot)com> writes:
> Is there a way to get the row count of a user table without doing the?
> select count(*) from <table>

If this were an easy problem, count() would do it for you ;-)

If you're willing to settle for an approximate answer,
pg_class.reltuples might do. It's the row count as of the last VACUUM.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Bruno Wolff III 2003-02-09 06:24:12 Re: table row count
Previous Message Martin Hurst 2003-02-09 05:08:59 table row count