Subject Re: Plan with udf funtions
Author legrand_legrand_63
--- In firebird-support@yahoogroups.com, "yartax1" <yartax@...> 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.
>

Hello,
Usualy RDBMS are not able to use indexes for columns on which
functions are applyied.
To do so you should have to use FUNCTION indexes ...

But to answer your need you could try to transform your query as:
select * from a where a.zone starting with 'EUR_'

Regards
PAscal