How to look at the Expression Trees

From: Vaibhav Kaushal <vaibhavkaushal123(at)gmail(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: How to look at the Expression Trees
Date: 2011-03-21 11:44:43
Message-ID: 1300707883.16100.13.camel@localhost
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi all,

I have been trying to work on the expression evaluator (trying to alter
it just for the seqscan case). I have understood a few things. I wish
someone could tell me if I am wrong at some point. As far as I have gone
through the code, I think:

1. Quals are formulated by planner
2. Quals are actually a list of Expression Trees.
3. They are created in the ExecInitExpr function.
4. Every row / tuple table slot is run through the same qual list and
thus goes through the same expression tree execution path as the other
(of course being filtered in between if they do not fit the qual in the
list).

5. The most common nodes in the expression trees are the ExecEvalVar,
ExecEvalConst and ExecEvalParam.

I might be wrong somewhere (especially most people would be able to say
a lot about the 5th point). But if the above were to be correct then how
and why are the ExecMakeFunctionResultNoSets, ExecEvalRelabelType,
ExecEvalFuncArgs and the likes are used?

I wanted to see how the expression tree gets into form before it gets
into the ExecQual for parse by ExecEvalExpr function. Is there a way to
see the Expression Tree so that I get a better idea about what is
happening?

Regards,
Vaibhav

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2011-03-21 12:17:38 Re: How to look at the Expression Trees
Previous Message Marti Raudsepp 2011-03-21 11:17:04 Planner regression in 9.1: min(x) cannot use partial index with NOT NULL