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

From Ron Johnson
Subject Re: Number of rows in a table
Date
Msg-id 1061833284.11922.65.camel@haggis
Whole thread Raw
In response to Re: Number of rows in a table  ("paul butler" <paul@entropia.co.uk>)
Responses Re: Number of rows in a table
List pgsql-novice
On Mon, 2003-08-25 at 11:08, paul butler wrote:
> From:               "Louise Cofield" <lcofield@box-works.com>
> To:                 <pgsql-novice@postgresql.org>
> Subject:            [NOVICE] Number of rows in a table
> Date sent:          Mon, 25 Aug 2003 10:06:28 -0600
>
> SELECT count(ColumnName) FROM TableName;
> should do the trick

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.

> > I haven't been able to figure out how to determine the number of
> > populated rows in a table - such as "select max(rownum)" in Oracle.

--
-----------------------------------------------------------------
Ron Johnson, Jr. ron.l.johnson@cox.net
Jefferson, LA USA

PETA - People Eating Tasty Animals


pgsql-novice by date:

Previous
From: Tomka Gergely
Date:
Subject: Re: Way to tell what SQL is currently running?
Next
From: "Patrick Hatcher"
Date:
Subject: Re: Way to tell what SQL is currently running?