Subject | Re: [IB-Architect] Query Optimiser |
---|---|
Author | Nando Dessena |
Post date | 2001-01-16T12:00:46Z |
Ivan,
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
> The problem is that plan is chosen at the time command (your SP)I think this is similar to the case
> 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.
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