Subject Re: [Firebird-Architect] "Adapted" PLAN for parametrized LIKE queries
Author Alex Peshkoff
On 03/14/12 17:11, Dmitry Yemanov wrote:
>> But looks like in the worst case
>> all plan can change depending upon use or not index in one place.
> This could be a problem if such conditional retrievals are used inside
> joins

Suppose in real cases it will be so.

> etc, especially if the predicate is a part of the relationship
> condition. We cannot estimate the cost properly at the prepare time. Of
> course we could suppose the worst case or use some average cost, but
> it's still something sub-optimal. More brainstorming is required here.

Probably we may keep as a plan for such queries (if someday we have
information about distribution on index values this problem will take
place not only for LIKE) some intermediate state of optimizer and
perform final steps later when request is executed? I understand well
that's not for 3.0 or we will never have a release.