Subject Re: [firebird-support] Does SIMILAR TO use an index?
Author W O
Yes Ann, you are right, but I said: "an index for the table", not for a
subset of a table for retrieval.

Greetings.

Walter.







On Fri, May 10, 2013 at 11:34 AM, Ann Harrison <aharrison@...>wrote:

> **
>
>
> 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]
>
>
>


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