Re: Does "explain (QueryTree [RAW| ANAYLZE|REWRITE] | Optimization [PULL_UP_BEFORE| PULL_UP_AFTER|...]) SELECT XXXX" helpful? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Does "explain (QueryTree [RAW| ANAYLZE|REWRITE] | Optimization [PULL_UP_BEFORE| PULL_UP_AFTER|...]) SELECT XXXX" helpful?
Date
Msg-id 55582.1463839961@sss.pgh.pa.us
Whole thread Raw
In response to Does "explain (QueryTree [RAW| ANAYLZE|REWRITE] | Optimization [PULL_UP_BEFORE| PULL_UP_AFTER|...]) SELECT XXXX" helpful?  (Hao Lee <mixtrue@gmail.com>)
List pgsql-hackers
Hao Lee <mixtrue@gmail.com> writes:
>    When we debugging or hacking the internal, the tedious things is to
> debug step by step the code, so that make sure the PostgreSQL generates the
> right raw syntax tree or query tree or the plans.  Therefore, i think if we
> have a uitility statment to show that, such as, we can using the explain
> statment to ouput  the raw syntax tree of a sql or the query tree, etc

FWIW, I usually just insert pprint() calls at appropriate places (or
even more usually, call it from gdb after setting a breakpoint somewhere).
The places where you want to see a node tree are varied and unpredictable,
so I rather doubt that a utility statement of this sort would be very
helpful.

See also the debug_print_parse, debug_print_rewritten, debug_print_plan
GUCs, which already do more or less what you're suggesting.

All of the above end up dumping into the postmaster log, not to the
client, but IME that's about as convenient if not more so.  You'd be
putting the output into a file anyway.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Hao Lee
Date:
Subject: Does "explain (QueryTree [RAW| ANAYLZE|REWRITE] | Optimization [PULL_UP_BEFORE| PULL_UP_AFTER|...]) SELECT XXXX" helpful?
Next
From: Euler Taveira
Date:
Subject: Re: [PATCH] Add EXPLAIN (ALL) shorthand