pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Josh Berkus <josh@agliodbs.com>
To: David B <postgresql@thegatelys.com>
To: pgsql-sql@postgresql.org
Subject: Re: Row counts/data changes. Any catalog table that has this info?
Date: Fri, 20 Feb 2004 10:53:36 -0800
Message-ID: <200402201053.36242.josh@agliodbs.com> (raw)
In-Reply-To: <GOEGKICPFOPNLIEIHGFJEEOPCHAA.postgresql@thegatelys.com>
References: <GOEGKICPFOPNLIEIHGFJEEOPCHAA.postgresql@thegatelys.com>

David,

> table_name    #Rows
> cust          1000
> order         5000
> order_detail  9500

If you're willing to live with some inaccuracy, do:

SELECT relname, reltuples FROM pg_class
WHERE relkind='r';

This count gets updated when you do a VACUUM, and is seldom 100% accurate; 
however, if you VACUUM regularly it will be within 5-10%.

-- 
-Josh Berkus
 Aglio Database Solutions
 San Francisco




view thread (3+ messages)

Message-ID: <200402201053.36242.josh@agliodbs.com>
Permalink:  ../200402201053.36242.josh@agliodbs.com/
Also on:    postgresql.org/message-id/200402201053.36242.josh@agliodbs.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: josh@agliodbs.com, postgresql@thegatelys.com
  Subject: Re: Row counts/data changes. Any catalog table that has this info?
  In-Reply-To: <200402201053.36242.josh@agliodbs.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox