Subject | RE: [firebird-support] Is there a way to optimize a count()? or am i doing it the wrong way? |
---|---|
Author | Leyne, Sean |
Post date | 2006-08-09T22:37:11Z |
Rick,
Accordingly, the engine must check if the record, referenced in the
index, actually exists.
Sean
> > Counting a lot of rows is slow in Firebird, it has to visit everytwenty
> 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 indexWhile *you* might know this, the *engine* doesn't.
> entries pointing to old, uncountable stuff.
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 inI would prefer to say: "You shouldn't COUNT on an MGA system"
> every case to be a facet of "you can't count on an MGA system."
Sean