Subject | Re: [firebird-support] use of 'LIKE %' |
---|---|
Author | Dimitry Sibiryakov |
Post date | 2005-04-21T10:10:52Z |
On 21 Apr 2005 at 9:16, Vahan Yoghoudjian wrote:
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.
>Is this a bad habit? Would it be better to change 'where status likeIt would be some better. Or not. Your current use of LIKE doesn't
>: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?
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.