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

From: Greg Smith <greg(at)2ndQuadrant(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: SELECT COUNT(*) execution time on large tables (v9.0.4-1)
Date: 2011-05-29 02:54:24
Message-ID: 4DE1B560.2050603@2ndQuadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)2ndQuadrant(dot)com Baltimore, MD
PostgreSQL Training, Services, and 24x7 Support www.2ndQuadrant.us
"PostgreSQL 9.0 High Performance": http://www.2ndQuadrant.com/books

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Darren Duncan 2011-05-29 02:55:54 timeouts on transactions etc?
Previous Message Greg Smith 2011-05-29 02:45:52 Re: Inspecting a DB - psql or system tables ?