Re: How to look at the Expression Trees

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Vaibhav Kaushal <vaibhavkaushal123(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: How to look at the Expression Trees
Date: 2011-03-21 13:24:15
Message-ID: 4D87517F.10502@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2011-03-21 13:32:31 Re: Planner regression in 9.1: min(x) cannot use partial index with NOT NULL
Previous Message Vaibhav Kaushal 2011-03-21 12:37:12 Re: How to look at the Expression Trees