Subject | Re: [firebird-support] Containing vs. Like |
---|---|
Author | Lucas Franzen |
Post date | 2004-09-23T12:51:58Z |
Primoz,
searches case sensitive whereas containing doesn't; so containing is
equivalent to UPPER(FIELD) LIKE '%TEXT%'), like will be faster if the
search field is indexed and can the search expression can be substitued
by a STARTING WITH (ie you do a LIKE 'text%').
Regards
Luc.
> Should bottom queries do the same thing ?Beside the fact that these methods produce different results (like
>
> select * from table where field like '%text%'
>
> select * from table where field containing 'text'
>
> Is any approach faster then another ?
searches case sensitive whereas containing doesn't; so containing is
equivalent to UPPER(FIELD) LIKE '%TEXT%'), like will be faster if the
search field is indexed and can the search expression can be substitued
by a STARTING WITH (ie you do a LIKE 'text%').
Regards
Luc.