Ron Johnson <ron.l.johnson@cox.net> 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.
If an approximate number is good enough, see pg_class.reltuples.
regards, tom lane