|Subject||Re: [firebird-support] = , LIKE, CONTAINING|
> Will there be any differents in the plan if we are using either '=' or= and STARTING can use index if available.
> 'LIKE' or 'CONTAINING'?
> If there is, which one is the fastest?
> Or maybe it varies according to the condition?
LIKE can use index only if string literal not starting with wildcard is used, i.e.
these can use index:
myfield LIKE 'abc%'
myfield LIKE 'abc%xyz'
myfield LIKE '%abc%'
myfield LIKE ?
CONTAINING never use index.
Note that CONTAINIG (unlike all other operators) is case-insensitive.
Also note that LIKE (unlike =) is sensitive to trailing spaces.
And do not foget that using index does not automatically mean
faster execution (e.g. low-selective queries like
"select * from tab where myfield starting 'a' "
are usually faster without index.)