Subject Re: [firebird-support] Re: Slow query (unindexed reads)
Author Ann Harrison
On Wed, Jun 22, 2011 at 8:41 AM, kerryneighbour <kerry@...> wrote:

>
> I do not care about the ORDER BY - I don't care about the order the records are processed in. I simply use it to try and force the use of an index. It did not work in this case, but I seem to recall it working in other cases.
>

In some databases, ORDER BY will cause the optimizer to use an index,
but not in Firebird unless you include a FIRST clause to restrict the
number of rows returned.

If you actually have to read all the rows in a table, the fastest way
to do it is to read them in storage order so you're not bouncing
around from page to page. Maybe you need to show us the real query.

Good luck,

Ann