Subject Re: Speed difference between = and LIKE
Author simonbenedicic
--- In firebird-support@yahoogroups.com, "RB Smissaert" <bartsmissaert@...> wrote:
>
>
> select field1 from table1 where field1 = 'abcde'
> select field1 from table1 where field1 like 'abcd%'
> select field1 from table1 where field1 starting with 'abcd'
>
> It looks not, but just want to make sure.

Hi,

Note that if you use parameters, the usage of index might me different -> that is true for stored procedures. In below example compiler of stored procedure will not know (at compile time) if "%" is at the end or at the begining of parameter or both, so it will not use an index.

select field1 from table1 where field1 like :Param

... in that case it is better to use "starting with".

Regards,

Simon