On 3/28/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
Hi,
I want to check the record count of a table every 5 seconds.
It seems there's only one way to get a table's record count:
select coun(*) from ATable

but if the table gets big(1,000,000 rows), it will get slow.
Any good idea?

create a table to hold the row count. Something like

CREATE TABLE rowcounts (tablename TEXT, rowcount INTEGER)

Add triggers that adjust the value of rowcount for each table on each
INSERT/DELETE.

Query table rowcounts instead of Count(*) table.


--
Puneet Kishor http://punkish.eidesis.org/
Nelson Inst. for Env. Studies, UW-Madison http://www.nelson.wisc.edu/
Open Source Geospatial Foundation http://www.osgeo.org/education/
---------------------------------------------------------------------
collaborate, communicate, compete
=====================================================================

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to