Subject Re: [firebird-support] Does SIMILAR TO use an index?
Author Ann Harrison
On Fri, May 10, 2013 at 10:54 AM, W O <sistemas2000profesional@...>wrote:

In my tests, SIMILAR TO never uses an index.
>

LIKE uses an index only if the expression starts with a literal value that
is known
at compile time. I guess SIMILAR TO could be taught to do the same, but
that
optimization hasn't yet been done. It's fairly restrictive because the
matching
string has to be a fixed value and not a parameter.


>
> Of course, you can force an index for the table with the clause ORDER BY
>
> You can? Yes, you can force Firebird to retrieve rows in indexed order
for
some simple queries, but that's not at all the same as using an index to
identify
a subset of a table for retrieval.

Good luck,

Ann


[Non-text portions of this message have been removed]