On 13/01/16 14:12, Pavel Stehule wrote:
> so the strategy - if cost of generic plan is less than some MAGIC CONSTANT
> (can be specified by GUC), then use generic plan. Elsewhere use a custom
> plan everytime.
>
> It allow to controll the plan reusing. When MAGIC CONSTANT = 0 .. use
> custom plan everytime, When MAGIC CONSTANT = M, then use generic plan
> always.
I don't think that would solve even the original problem without
effectively disabling generic plans, despite the problem being
relatively simple. The generic plan appears to be really cheap, because
the planner doesn't have the concept of a "worst case".
.m