Subject Re: [firebird-support] Re: Progress of a Stored Procedure Feedback
Author Ann W. Harrison
Adam wrote:
>
> As external tables can not be indexed,

Ah, I'd missed the fact that the table is external. In
that case, you can't delete records, so the sort isn't
important.

> I would hesitate at taking such
> an approach if the table is large. There is always a trade-off between
> the speed of getting it done and the amount of feedback, but the select
> first skip query without a supporting index will just get slower the
> further down the list it gets.


Err, unfortunately, the index is not a panacea as you progress
through a table using the FIRST ... SKIP method. The index
gives you rapid access to the initial group of values in sorted
order. However for the second group, Firebird still reads all
the records in the first group, then reads the records in the
second group. For the third group, it reads all the records in
the first two groups, then starts returning records in the third
group.

The long and short of it is, if you want to access a whole table,
the fastest way to do it is to access the whole table in a single
statement. The next best solution is to add an indexed field that
subdivides the table.

Search engine semantics are very useful, but they only work because
search engines are not expected to produce exact reproducible
results.

Regards,


Ann


Regards,


Ann