You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@trafodion.apache.org by Dave Birdsall <da...@esgyn.com> on 2015/11/04 00:47:43 UTC

Good ways to see query trees during compilation?

Hi,



I’ve been debugging some issues in the Trafodion compiler where the fix
involves transforming the query tree in a certain way. One issue I’m
running into is getting the transformation right. What would be really
helpful is some utility that would show the details of a tree (the RelExpr
nodes and all the dangling ItemExpr subtrees under it, complete with
ValueIDs) so I could compare my transformation with other transformations;
that is, so I can get a visual picture of what a good transformation looks
like.



I have been using the DISPLAY utility, but it doesn’t seem to show the
ItemExpr subtrees. Perhaps there’s a bug in there that needs to be fixed?



The ItemExpr nodes have a display() method that is handy to call from gdb.
If I could have something like that on RelExpr nodes as well, and with
ValueIDs added in all the ItemExpr nodes, that would be great, I think.



Perhaps this capability exists and I just haven’t stumbled upon it yet?



Thanks for any suggestions,



Dave

RE: Good ways to see query trees during compilation?

Posted by Dave Birdsall <da...@esgyn.com>.
Hi Suresh,

Thanks! I haven't always had success clicking on the "I" button on the menu
bar. So that may be buggy. But I didn't know about right-clicking on the RE
nodes. I'll give that a try.

Dave

-----Original Message-----
From: Suresh Subbiah [mailto:suresh.subbiah60@gmail.com]
Sent: Wednesday, November 4, 2015 4:59 PM
To: dev@trafodion.incubator.apache.org
Subject: Re: Good ways to see query trees during compilation?

Hi Dave,

The "I" (Capital i) button in display should work. ItemExpr tree can also be
seen by right clicking on a RelExpr and choosing ItemExpr from the drop down
menu (three choices in the menu I think). One can oonly see ItemExpr trees
at the end of major compiler phases though with DISPLAY. Also maybe not all
ItemExpr trees of a RelExpr are displayed, only the ones the tool is is
aware of.

Thanks
Suresh

On Tue, Nov 3, 2015 at 6:53 PM, Hans Zeller <ha...@esgyn.com> wrote:

> Hi Dave,
>
> Many years ago, we used to have a method ExprNode::displayTree() that
> would invoke the GUI display tool from the debugger, so you could look
> at a tree not just at the end of each phase but also in-between. It
> looks like the current GUI does not support this feature, but maybe we
> could try to bring it back. I don't know how much work that would be.
>
> Hans
>
> On Tue, Nov 3, 2015 at 3:47 PM, Dave Birdsall
> <da...@esgyn.com>
> wrote:
>
> > Hi,
> >
> >
> >
> > I’ve been debugging some issues in the Trafodion compiler where the
> > fix involves transforming the query tree in a certain way. One issue
> > I’m running into is getting the transformation right. What would be
> > really helpful is some utility that would show the details of a tree
> > (the
> RelExpr
> > nodes and all the dangling ItemExpr subtrees under it, complete with
> > ValueIDs) so I could compare my transformation with other
> transformations;
> > that is, so I can get a visual picture of what a good transformation
> looks
> > like.
> >
> >
> >
> > I have been using the DISPLAY utility, but it doesn’t seem to show
> > the ItemExpr subtrees. Perhaps there’s a bug in there that needs to be
> > fixed?
> >
> >
> >
> > The ItemExpr nodes have a display() method that is handy to call
> > from
> gdb.
> > If I could have something like that on RelExpr nodes as well, and
> > with ValueIDs added in all the ItemExpr nodes, that would be great, I
> > think.
> >
> >
> >
> > Perhaps this capability exists and I just haven’t stumbled upon it yet?
> >
> >
> >
> > Thanks for any suggestions,
> >
> >
> >
> > Dave
> >
>

Re: Good ways to see query trees during compilation?

Posted by Suresh Subbiah <su...@gmail.com>.
Hi Dave,

The "I" (Capital i) button in display should work. ItemExpr tree can also
be seen by right clicking on a RelExpr and choosing ItemExpr from the drop
down menu (three choices in the menu I think). One can oonly see ItemExpr
trees at the end of major compiler phases though with DISPLAY. Also maybe
not all ItemExpr trees of a RelExpr are displayed, only the ones the tool
is is aware of.

Thanks
Suresh

On Tue, Nov 3, 2015 at 6:53 PM, Hans Zeller <ha...@esgyn.com> wrote:

> Hi Dave,
>
> Many years ago, we used to have a method ExprNode::displayTree() that would
> invoke the GUI display tool from the debugger, so you could look at a tree
> not just at the end of each phase but also in-between. It looks like the
> current GUI does not support this feature, but maybe we could try to bring
> it back. I don't know how much work that would be.
>
> Hans
>
> On Tue, Nov 3, 2015 at 3:47 PM, Dave Birdsall <da...@esgyn.com>
> wrote:
>
> > Hi,
> >
> >
> >
> > I’ve been debugging some issues in the Trafodion compiler where the fix
> > involves transforming the query tree in a certain way. One issue I’m
> > running into is getting the transformation right. What would be really
> > helpful is some utility that would show the details of a tree (the
> RelExpr
> > nodes and all the dangling ItemExpr subtrees under it, complete with
> > ValueIDs) so I could compare my transformation with other
> transformations;
> > that is, so I can get a visual picture of what a good transformation
> looks
> > like.
> >
> >
> >
> > I have been using the DISPLAY utility, but it doesn’t seem to show the
> > ItemExpr subtrees. Perhaps there’s a bug in there that needs to be fixed?
> >
> >
> >
> > The ItemExpr nodes have a display() method that is handy to call from
> gdb.
> > If I could have something like that on RelExpr nodes as well, and with
> > ValueIDs added in all the ItemExpr nodes, that would be great, I think.
> >
> >
> >
> > Perhaps this capability exists and I just haven’t stumbled upon it yet?
> >
> >
> >
> > Thanks for any suggestions,
> >
> >
> >
> > Dave
> >
>

Re: Good ways to see query trees during compilation?

Posted by Hans Zeller <ha...@esgyn.com>.
Hi Dave,

Many years ago, we used to have a method ExprNode::displayTree() that would
invoke the GUI display tool from the debugger, so you could look at a tree
not just at the end of each phase but also in-between. It looks like the
current GUI does not support this feature, but maybe we could try to bring
it back. I don't know how much work that would be.

Hans

On Tue, Nov 3, 2015 at 3:47 PM, Dave Birdsall <da...@esgyn.com>
wrote:

> Hi,
>
>
>
> I’ve been debugging some issues in the Trafodion compiler where the fix
> involves transforming the query tree in a certain way. One issue I’m
> running into is getting the transformation right. What would be really
> helpful is some utility that would show the details of a tree (the RelExpr
> nodes and all the dangling ItemExpr subtrees under it, complete with
> ValueIDs) so I could compare my transformation with other transformations;
> that is, so I can get a visual picture of what a good transformation looks
> like.
>
>
>
> I have been using the DISPLAY utility, but it doesn’t seem to show the
> ItemExpr subtrees. Perhaps there’s a bug in there that needs to be fixed?
>
>
>
> The ItemExpr nodes have a display() method that is handy to call from gdb.
> If I could have something like that on RelExpr nodes as well, and with
> ValueIDs added in all the ItemExpr nodes, that would be great, I think.
>
>
>
> Perhaps this capability exists and I just haven’t stumbled upon it yet?
>
>
>
> Thanks for any suggestions,
>
>
>
> Dave
>