Thread: Usage of planner_ctx

Usage of planner_ctx

From
Amit Kapila
Date:
<div class="WordSection1"><p class="MsoNormal">PlannerInfo->planner_ctx is assigned with either MessageContext or
PortalHeapMemorydepending on the flow from which planner is invoked.<p class="MsoNormal">My doubt is that during whole
planningprocess till the Plan is stored in PlannedStmt, all the memory is from CurrentMemoryContext which is same as
PlannerInfo->planner_ctx.<pclass="MsoNormal"> <p class="MsoNormal">So what is the use of having
 PlannerInfo->planner_ctxwhich only contains CurrentMemoryContext?<p class="MsoNormal"> </div> 

Re: Usage of planner_ctx

From
Tom Lane
Date:
Amit Kapila <amit.kapila@huawei.com> writes:
> So what is the use of having  PlannerInfo->planner_ctx which only contains
> CurrentMemoryContext?

It might be clearer if you read up on the memory management in GEQO
planning mode.
        regards, tom lane