pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Matt Mello <alien@spaceship.com>
To: pgsql-performance@postgresql.org
Subject: Faster 'select count(*) from table' ?
Date: Tue, 25 Feb 2003 16:44:13 -0600
Message-ID: <3E5BF1BD.9070301@spaceship.com> (raw)
In-Reply-To: <15034.1045842303@sss.pgh.pa.us>
References: <3E564695.7030906@digital-ics.com>
	<15034.1045842303@sss.pgh.pa.us>

Does anyone know if there is a fast way to find out how many records are 
in a table?

"Select count(*) from table" is very slow.

I would think that PG would keep up with the number of undeleted rows on 
a realtime basis.  Is that the case?  If so, how would I query it?

Hope this is the correct list for this question.

Thanks!

-- 
Matt Mello





view thread (2+ messages)  latest in thread

Message-ID: <3E5BF1BD.9070301@spaceship.com>
Permalink:  ../3E5BF1BD.9070301@spaceship.com/
Also on:    postgresql.org/message-id/3E5BF1BD.9070301@spaceship.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-performance@postgresql.org
  Cc: alien@spaceship.com
  Subject: Re: Faster 'select count(*) from table' ?
  In-Reply-To: <3E5BF1BD.9070301@spaceship.com>
  References: <3E564695.7030906@digital-ics.com> <15034.1045842303@sss.pgh.pa.us> <3E5BF1BD.9070301@spaceship.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox