Faster 'select count(*) from table' ?

From: Matt Mello <alien(at)spaceship(dot)com>
To: pgsql-performance(at)postgresql(dot)org
Subject: Faster 'select count(*) from table' ?
Date: 2003-02-25 22:44:13
Message-ID: 3E5BF1BD.9070301@spaceship.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

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

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message scott.marlowe 2003-02-25 23:25:26 Re: Faster 'select count(*) from table' ?
Previous Message Peter Childs 2003-02-25 16:36:11 Re: slow query