Re: Delaying the planning of unnamed statements until Bind - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Delaying the planning of unnamed statements until Bind
Date
Msg-id 3687.1085190912@sss.pgh.pa.us
Whole thread Raw
In response to Re: Delaying the planning of unnamed statements until Bind  (Oliver Jowett <oliver@opencloud.com>)
List pgsql-hackers
Oliver Jowett <oliver@opencloud.com> writes:
> Ok, so something like this?
> 1) eval_const_expressions takes a list of parameter values and does 
> Param to Const replacement if given parameters.
> 2) The main planner does not pass parameters to eval_const_expressions.
> 3) When the selectivity functions care about a Const vs non-Const value 
> and they are dealing with a non-leaf expression node, they call 
> eval_const_expressions passing the expression tree & the planner-global 
> parameter values, and then look at the result's Const-ness again.

Right.

> There appear to be a few other places where Const vs. Param affects the 
> resulting plan (clause_selectivity, LIMIT/OFFSET support, etc). Do the 
> same thing there?

clause_selectivity could reasonably do this.  Not sure about
LIMIT/OFFSET.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Oliver Jowett
Date:
Subject: Re: Delaying the planning of unnamed statements until Bind
Next
From: Greg Stark
Date:
Subject: Re: Delaying the planning of unnamed statements until Bind