Subject | Re: [ib-support] Re: containing, like, = |
---|---|
Author | Paul Beach |
Post date | 2001-09-04T08:38:10Z |
> >I think LIKE 'XY%' use indexes, but LIKE '%XY%' doesn't.No need to think:-), the answer is yes it does assuming that 'XY%' is an
indexed field.
LIKE '%XY%' can't use an index because index keys are read left to right.
LIKE '%XY%' works in exactly the same way as STARTING WITH, i.e. it is
optimised the same way if an index is there is will be used.
This optimisation feature was added around the 4.x time frame if I remember
rightly. So if you have an older version of InterBase (3.3) you may not see
this behaviour.
Regards
Paul Beach
Main Tel (UK):+44 (0) 1844 354465
Mobile: (UK): +44 (0) 7764 188603
http://www.ibphoenix.com