Subject Re: [Firebird-Architect] "Adapted" PLAN for parametrized LIKE queries
Author Alex Peshkoff
On 03/14/12 14:17, Thomas Steinmaurer wrote:
>> Another solution I can think of is to prepare this particular retrieval
>> with two different access paths (NATURAL and INDEX) and choose between
>> them at runtime based on the parameter value.
> Sounds good. Again. Only for those kind of statements, where an
> execution plan could differ for already known parameter values.
>

What if there are >1 places in the query where execution plan can
differ? Looks like we get exponential growth of memory used for such
prepared queries if we duplicate all plan. Or may be we talk about
having a kind of "if" inside the plan? But looks like in the worst case
all plan can change depending upon use or not index in one place.