Subject Re: [firebird-support] Re: Simpel query question - speed
Author Martijn Tonies
>> > The selectivity to index POINT_KVIT_IDX1 is 0,00000142520 or less
>>
>> Bad, if I recall correctly.
>
> Yes, but I have some that a worse ;-)
>
>
> Select
> ID, BonNr, Tekst
> from Point_Kvit
> Where BonNr = 2236136
> Order by ID+0
>
>
> Also works perfect.
>
> But I would like to know why.

Because of the expression, it cannot use the index for sorting.

Given that your result returns just a few rows, it should sort those
rows without the index, as hopping arround the index to find the
row, put them in sorting order etc takes more time.

With regards,

Martijn Tonies
Upscene Productions
http://www.upscene.com

Download Database Workbench for Oracle, MS SQL Server, Sybase SQL
Anywhere, MySQL, InterBase, NexusDB and Firebird!

Database questions? Check the forum:
http://www.databasedevelopmentforum.com