Subject RE: [firebird-support] Is there a way to optimize a count()? or am i doing it the wrong way?
Author Leyne, Sean

> > Counting a lot of rows is slow in Firebird, it has to visit every
> record that it could possibly count to find out whether it should be
> visible to the current transaction.
> This doesn't make sense in this case. Given the transaction numbers,
> there are no old transactions holding old records. Therefore all
> index entries point to good, countable items, and there are no index
> entries pointing to old, uncountable stuff.

While *you* might know this, the *engine* doesn't.

Accordingly, the engine must check if the record, referenced in the
index, actually exists.

> Perhaps there is a problem with count(), and it was always assumed in
> every case to be a facet of "you can't count on an MGA system."

I would prefer to say: "You shouldn't COUNT on an MGA system"