Subject Re: [ib-support] Is there a way to determine implied cursor result set size ???
Author Paul Reeves
Robert S. Sciuk wrote:
>
> I apologize in advance if this is an FAQ, but I've never seen it on any of
> the web resources I've scanned (quite a few, actually). Doc pointers
> would be very welcome!
>

Actually, this limitation is sort of documented - you just asked the
question in the wrong way! Typically the discussion revolves around the
use of 'select count()' and why it takes so long.

Essentially the answer is to do with the multi-generational
architecture. Because of versioning it is impossible to maintain an
accurate count as the value will usually differ from transaction to
transaction. Hence there is no api call to do this a priori. You need to
do a 'select count()', which takes a long time as every row must be
checked for the correct version for the current transaction.

So, you have a choice - either lay in the overhead of running a count
query first, or dispense with this and fetch rows as needed. The new
Firebird FIRST SKIP syntax should help with this.


Paul
--

Paul Reeves
http://www.ibphoenix.com
Supporting users of Firebird and InterBase