Subject Re: [Firebird-Architect] IN LIST
Author Adriano dos Santos Fernandes
Arno Brinkman wrote:
> Hi,
>
>
>>> At which point (layer) do you expand the list (represented as string) into the new evaluation
>>> items
>>> ((ID BETWEEN 5 and 10) or (ID BETWEEN 20 and 30) or (ID = 50))?
>>>
>>>
>> In the optimizer.
>>
>
> It doesn't belong there IMO.
>
>
>>> If i correctly understand this wouldn't be able to use an index on ID.
>>>
>>>
>> It could be handled for index walk as BETWEEN X AND Y, with X being the
>> lesser and Y being the higher value of the list.
>>
>
> Then it should be before the optimizer, but what when a parameter is used?
>
Sorry Arno, I mixed things... :-(

I mean, the optimizer handle it as a BETWEEN, for index use.
Some layer (is EVL? I think you knows better than me :-)), should peek
the min and max value to search in the index.

And EVL evaluates it, without transformations to BETWEEN/IN, but
evaluating as BETWEEN/IN.

So, no problems with parameters.


Adriano