Re: Number of rows in a table - Mailing list pgsql-novice

From Tom Lane
Subject Re: Number of rows in a table
Date
Msg-id 10653.1061844798@sss.pgh.pa.us
Whole thread Raw
In response to Re: Number of rows in a table  (Ron Johnson <ron.l.johnson@cox.net>)
List pgsql-novice
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

pgsql-novice by date:

Previous
From: Juan Francisco Diaz
Date:
Subject: Using RECORD returning functions with JDBC
Next
From: "Juan Francisco Diaz"
Date:
Subject: INSERT INTO foo (col1,col2,...,coln) not working