ron.l.johnson@cox.net (Ron Johnson) writes:
> Well yes, but in most other databases, there is a system table that
> stores the approximate number of records in each table, and querying
> that system table is a *lot* faster than sequentially reading a 100M
> row table.
That relation would be pg_class, the domain is called "reltuples."
It is only about as accurate as the last vacuum and/or analyze has
made it, so if you don't fairly regularly vacuum tables, the
approximation may not be very good. (Which is an argument in favor of
vacuuming fairly often...)
--
select 'cbbrowne' || '@' || 'libertyrms.info';
<http://dev6.int.libertyrms.com/>
Christopher Browne
(416) 646 3304 x124 (land)