Interbase is a generational database.
That's great because rollbacks are near instantaneous, but count(*)
takes forever.
This is unlike e.g. MySQL where count can use an index.
I never knew why until I saw this:
Even when an index is available on the column or columns included in the COUNT, all records must be visited in order to see if they are visible under the current transaction isolation.
On wikipedia: http://en.wikipedia.org/wiki/InterBase
Any tips on how to do fast counting in Interbase/Firebird