Обсуждение: Expression Evaluator used for creating the plan tree / stmt ?
I see that the target list to be scanned is handled by "ExecTargetList" function.I am not so sure about this because this function is not listed in the list of functions which GDB shows me (./configure --enable-debug && make clean && make && make install). Rest everything else (almost / perhaps) is shown! (Can anyone tell why? :( )
Excerpts from Vaibhav Kaushal's message of mié may 25 05:52:32 -0400 2011:
> If the above is confusing, I just want to ask: "Is expression evaluator,
> even in part responsible for {PLANNEDSTMT creation?"
Yeah, as far as I understood Tom's talk, the expr evaluator is used to
reduce some expressions to constants and such.
--
Álvaro Herrera <alvherre@commandprompt.com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support
Alvaro Herrera <alvherre@commandprompt.com> writes:
> Excerpts from Vaibhav Kaushal's message of mié may 25 05:52:32 -0400 2011:
>> If the above is confusing, I just want to ask: "Is expression evaluator,
>> even in part responsible for {PLANNEDSTMT creation?"
> Yeah, as far as I understood Tom's talk, the expr evaluator is used to
> reduce some expressions to constants and such.
The planner would never call it with an expression containing a Var,
though.
regards, tom lane
@pavan - thanks a lot. Will try it when i go to desktop the next time.
--
Sent from my Android
> On Wed, May 25, 2011 at 3:22 PM, Vaibhav Kaushal <
> vaibhavkaushal123@gmail.com> wrote:
>
>> I see that the target list to be scanned is handled by "ExecTargetList"
>> function.
>>
>> I am not so sure about this because this function is not listed in the list
>> of functions which GDB shows me (./configure --enable-debug && make clean &&
>> make && make install). Rest everything else (almost / perhaps) is shown!
>> (Can anyone tell why? :( )
>>
>>
> You would need to turn optimization off by passing "-O0" flag to the
> compiler. Otherwise static functions may get optimized and you may not see
> them in gdb stack.
>
> CFLAGS="-O0" ./configure --enable-debug
>
> Thanks,
> Pavan
>
> --
> Pavan Deolasee
> EnterpriseDB http://www.enterprisedb.com
But somehow the execevalvar is being called. When i changed the logic of its working to use slot_getattr instead of cute_datum_array for the first run / call, everything just worked!
This would indicate surely that the function does get called at least once before being called by executor for qual check. This is what got me confused - where does the function get called? Gdb trace says its first call comes through ExecutePlan but results say something else. Moreover, gdb still confuses me. Is there some gui to gdb? :(
The only thing i am trying to make sure that ExecEvalVar gets the values from cute_datum_array only when called durin a scan, no way before it. May be there could be another way. I think i have to rethink about this.
--
Sent from my Android
> Alvaro Herrera <alvherre@commandprompt.com> writes:
>> Excerpts from Vaibhav Kaushal's message of mié may 25 05:52:32 -0400 2011:
>>> If the above is confusing, I just want to ask: "Is expression evaluator,
>>> even in part responsible for {PLANNEDSTMT creation?"
>
>> Yeah, as far as I understood Tom's talk, the expr evaluator is used to
>> reduce some expressions to constants and such.
>
> The planner would never call it with an expression containing a Var,
> though.
>
> regards, tom lane
On Wed, May 25, 2011 at 12:34 PM, Vaibhav Kaushal <vaibhavkaushal123@gmail.com> wrote: > But somehow the execevalvar is being called. When i changed the logic of its > working to use slot_getattr instead of cute_datum_array for the first run / > call, everything just worked! This is what gdb is for... set a breakpoint on that function using "b ExexEvalVar", and when it hits the breakpoint, use "bt" to see where the call came from. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company