Subject RE: [firebird-support] I can't believe Firebird's record count is not optimized...
Author Alan McDonald
> I can't believe it doesn't have such basic feature, I need to make
> paginated consults of a 3.6 millions table and when I need to count the
> record to get the number of pages needed It takes to long, the plan is
> natural and is slow.
>
> Im so dissapointed.
>

there are methods to keep table counts. Here's one:
Create another table with the table name and a bigint.
update the table with the select count(*) method
On delete and insert trigger for each respective table, insert tablename, +1
and tablename, -1 for inserts and deletes respectively.
Now the sum(rcount) where tablename=:tablename will give you fast table
counts.
Every so often, reconsolidate the table by removing all -1 and +1 entries
and replace them with the select COUNT(*) totals.

Alan