Subject Re: [firebird-support] Re: Plan not what I expected
Author Dmitry Yemanov
"chrisacron" <chris@...> wrote:
> mmmmm This is on a LI-V2.0.0.12691 Firbird 2.0 Release Candidate 3
> server running in Linux Superserver. So the plan is still not what I
> expected.

Is the database in ODS11? I.e. has it been restored on FB2?

> You say: "The current optimizer cannot use the same index for both
> retrieval and sorting..."
> This surpises me and would account for the re-ordering delays as it
> reads everything and sorts it - which it won't have to if it read the
> records in the correct sequnce to start off with.

It depends on what do you need to perform fast. A SORT plan is usually
faster to fetch the entire ordered set whilst an ORDER plan is faster to
deliver you the first rows.

> Do you know if there are any plans to change the optimiser to use the
> same key for retrieval and sorting - it would make the world of
> difference.

Yes, such an improvement will appear in the next FB version.