Subject Re: [IB-Architect] Query Optimiser
Author Nando Dessena
Ivan,

> The problem is that plan is chosen at the time command (your SP)
> is prepared (and parameter values are unkonwn), not when it is executed.!
> But you expect that IB will choose one plan for INVNO=-1
> and different plan for INVNO<>-1.

I think this is similar to the case

select ... from ...
where somefield like 'start%'

This will use an index on column somefield.
If a parameter is used

select ... from ...
where somefield like :param

The index is ignored even if you put param = 'start%' (using starting
[with] does solve the problem, of course).

Just wondering if there's a way to optimize such cases.
--
____
_/\/ando