Re: How to look at the Expression Trees - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: How to look at the Expression Trees
Date
Msg-id 4D87517F.10502@enterprisedb.com
Whole thread Raw
In response to Re: How to look at the Expression Trees  (Vaibhav Kaushal <vaibhavkaushal123@gmail.com>)
List pgsql-hackers
On 21.03.2011 14:37, Vaibhav Kaushal wrote:
> I am already using the postgresql server with -d 4 option and it shows a
> lot of things. But I am not able to see the Expression State trees.

To be precise, debug_print_plan=on prints the expression tree that comes 
from planner, not the execution tree of ExprStates. But the structure of 
the ExprState tree is the same as the planner tree, you just have 
ExprState nodes in place of Expr nodes.

> OK. I
> know that the output DOES show the 'expr' entries. But if those are what
> make the Expression _tree_ then I am not able to understand them. A little
> help on that would be generous.

It is indeed a tree that gets printed with debug_print_plan. There's 
more than the expression tree there, with information about planner the 
relations involved etc. Look for "targetlist" and "qual" fields in the 
output, that's where the expression trees are.

--   Heikki Linnakangas  EnterpriseDB   http://www.enterprisedb.com


pgsql-hackers by date:

Previous
From: Vaibhav Kaushal
Date:
Subject: Re: How to look at the Expression Trees
Next
From: Robert Haas
Date:
Subject: Re: Planner regression in 9.1: min(x) cannot use partial index with NOT NULL