Subject Re: [firebird-support] = , LIKE, CONTAINING
Author Ivan Prenosil
> Will there be any differents in the plan if we are using either '=' or
> If there is, which one is the fastest?
> Or maybe it varies according to the condition?

= and STARTING can use index if available.

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'

these can't:
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.)