Re: SELECT COUNT(*) execution time on large tables (v9.0.4-1) - Mailing list pgsql-general

From Greg Smith
Subject Re: SELECT COUNT(*) execution time on large tables (v9.0.4-1)
Date
Msg-id 4DE1B560.2050603@2ndQuadrant.com
Whole thread Raw
In response to SELECT COUNT(*) execution time on large tables (v9.0.4-1)  ("Carlos Sotto Maior \(SIM\)" <csotto@sistemassim.com.br>)
List pgsql-general
On 05/27/2011 12:41 PM, Carlos Sotto Maior (SIM) wrote:
> I have browsed catalog tables, digging for a real time Row.count but  so far
> did not find any.
>

See http://wiki.postgresql.org/wiki/Slow_Counting which shows you where
the one system count estimate is at, as well as suggesting links to
where you can find alternate approaches here.  If you need an exact
count and can't afford to generate a full query to find one, some sort
of trigger-based approach is likely where you'll need to go.

--
Greg Smith   2ndQuadrant US    greg@2ndQuadrant.com   Baltimore, MD
PostgreSQL Training, Services, and 24x7 Support  www.2ndQuadrant.us
"PostgreSQL 9.0 High Performance": http://www.2ndQuadrant.com/books


pgsql-general by date:

Previous
From: Greg Smith
Date:
Subject: Re: Inspecting a DB - psql or system tables ?
Next
From: Greg Smith
Date:
Subject: Re: Regular disk activity of an idle DBMS