Subject Re: [firebird-support] Re: First word after in alphabetical order
Author Eric SIBERT
> Assuming BOTH these indexes are available, it should run in a few ms
>
> SELECT FIRST 11
> ID_NAME
> FROM NAMES
> WHERE NAME>='FISHE'
> ORDER BY NAME;

I agree with you. We can imagine a way to answer this request in few ms.
But it's not that case. I also tried with a numeric field. And I
obtained similar times. But I replaced 'FISHE' by 'ZZTOP'. And now it
takes less than one second. I imagine FB is browsing all the table after
the wanted name. And in some cases, it is similar to the whole table.

So I would say, SELECT FIRST request can be optimized when WHERE and
ORDER BY use the same field (rougthly)... and I'm very interested in
such optimization :-)


Do you agree with my understanding of the problem?

Eric