Subject Re: [firebird-support] use of 'LIKE %'
Author Dimitry Sibiryakov
On 21 Apr 2005 at 9:16, Vahan Yoghoudjian wrote:

>Is this a bad habit? Would it be better to change 'where status like
>:ItemStatus' to 'where status = :ItemStatus' and omit this condition
>part when all items have to be fetched or Firebird ignores conditions
>like 'LIKE %' since all records have to be fetched anyway?

It would be some better. Or not. Your current use of LIKE doesn't
allow FB to use index on field status if any, so FB scan whole table.
On the other hand, the index may make things worse if number of
different statuses is small because it add scan of the index to
(almost) full scan of the table.
I'm afraid, only experiment may show whether if LIKE is suitable in
this case or not.
SY, Dimitry Sibiryakov.