Subject Re: First word after in alphabetical order
Author Adam
--- In firebird-support@yahoogroups.com, Eric SIBERT <courrier@e...>
wrote:
> > 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.

That is the first thing you should check. Get yourself an admin tool
that graphically shows you the plan of the query. IBPlanalyzer is
simple enough and free.

Is this the exact query you are running or is this a simplified
representation of your actual query?

Adam