Subject Re: [firebird-support] Plan with udf funtions
Author Svein Erling Tysvaer
Firebird 1.5 cannot index anything but columns (I think). Think about
it, it would be a tremendous amount of waste if it should index every
internal function applied to every field, let alone external functions.
Hence, not even

Select *
from table A
where a.zone CONTAINING 'EUR_'

can use an index.

I think Firebird 2.0 can index expressions, but then you have to do
something like

CREATE INDEX MyUDFIndex ON substr(a.zone,1,4)

and I doubt (I haven't tried, and would be happy if I'm wrong) that
index could be used with substr(a.zone,1,3).

Set

yartax1 wrote:
> Hi,
>
> One question, did fb 1.5 benefits of indexes with udf functions?
>
> Example:
>
> I have next query:
>
> Select *
> from table A
> where substr(a.zone,1,4) = 'EUR_'
>
> with a index on a.zone
>
> If I run the query, the plan was PLAN(A NATURAL)!!!
>
> Is that correct?
>
> Must to create two columns; one with zone and another with zone_prefix
> to benefit of index?
>
> Thanks.
> Yartax.