qinligeng-9Onoh4P/[EMAIL PROTECTED] wrote:
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?
Store record count in a separate table, use triggers to keep it
up-to-date as rows get added and deleted in the main table.
In fact, instead of polling, you can use the same triggers to notify you
of changes, e.g. by having them call a custom function.
Igor Tandetnik
-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------