Re: Automatic function replanning - Mailing list pgsql-hackers

From Lukas Kahwe Smith
Subject Re: Automatic function replanning
Date
Msg-id 43AB1A66.70305@pooteeweet.org
Whole thread Raw
In response to Automatic function replanning  (Joachim Wieland <joe@mcknight.de>)
Responses Re: Automatic function replanning
List pgsql-hackers
Bruce Momjian wrote:

> Right, if the cardinality changes, you realize this before execution and
> optimize/save the plan again.  A further optimization would be to save
> _multiple_ plans for a single prepared plan based on constants and
> choose one of the other, but that is beyond where we are willing to
> consider at this stage, I think.

ok .. so you store the cardinality that was used when generating the
original plan. on the next execution you look up the cardinality again
and compare it, if its off too much, you replan. however this could in
extreme cases mean that you replan on every execution and thereby
killing off the entire advantage of storing the plan. but thats the
absolute worse case scenario.

regards,
Lukas

PS: bruce original email was only send to me directly ..






pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Automatic function replanning
Next
From: "Jim C. Nasby"
Date:
Subject: Re: Function call with offset and limit