Subject Re: [firebird-support] Optimizing this select Query
Author Alexandre Benson Smith
Em 10/4/2014 19:42, Thomas Beckmann escreveu:
> Hm, this is just getting rid of using the index on sku - depending on
> it's selectivity, this might be a way, but than, the index might be of
> no use...
>
>> SALEITEMS.SKU+0 = :vSKU AND
> You might check combined indexes...

It's avoiding to use the index in this particular query, it does not
mean it has no use... In a diferent query it could be a good index. And
I think this index is generated by a FK constraint, and could not be
removed.

How he can combine the index of two distinct tables ?

To the OP:
If you change the query to use fixed values instead of parameters does
it change anything ? I cant remember if the FB optimizer take in count
the range of the between, I don't think so, but you could give it a try.