From: | Vaibhav Kaushal <vaibhavkaushal123(at)gmail(dot)com> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | pgsql-hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: When and how many times does ExecSetParamPlan executes? |
Date: | 2011-03-25 19:12:21 |
Message-ID: | 1301080341.4573.21.camel@localhost |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Thanks for the reply Mr. Tom.
So, I think that the function ExecSetParamPlan (as the code suggests
too) is called _once_ in any plan/expression and that should be mostly
for a sub-select query.
Kindly correct me if I am wrong. Since I am not able to understand this
usecase completely, a sample query which is capable of calling this
function (ExecSetParamPlan) could show some light. It would be really
kind of you / anyone to show me a query executable through psql which
can actually call ExecSetParamPlan and involves the use of a on-disk
relation.
The reason I am asking for a query which I could run on psql is that I
am using gdb to debug (and notice the steps taken by) PG.
Regards,
Vaibhav
On Fri, 2011-03-25 at 14:37 -0400, Tom Lane wrote:
> Vaibhav Kaushal <vaibhavkaushal123(at)gmail(dot)com> writes:
> > Hello all,
> > I was going through the Expression Evaluator and was trying to
> > understand how the expressions are formed and evaluated. I was informed
> > on the IRC channel that the PARAM nodes are quite important and many
> > well written client applications use PARAMs for sending query to the
> > backend. I found while looking at the ExecEvalParam function that a call
> > is made to the ExecSetParamPlan for the first time when the PARAM is
> > caught in the ExprState tree.
>
> > I am confused about how many times the call is made to the
> > ExecSetParamPlan funtion.
>
> Indeed ... ExecSetParamPlan has nothing at all to do with Params
> representing values coming from a client (PARAM_EXTERN parameters).
> It's used in connection with PARAM_EXEC parameters that represent
> the outputs of InitPlan subplans (that is, execute-only-once subplans).
>
> regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | Robert Haas | 2011-03-25 19:18:41 | Re: SSI bug? |
Previous Message | Robert Haas | 2011-03-25 19:06:59 | Re: Pre-set Hint bits/VACUUM FREEZE on data load..? |