Re: Easily reading debug_print_plan

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Craig Ringer <craig(at)2ndquadrant(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Easily reading debug_print_plan
Date: 2013-11-20 14:36:26
Message-ID: 11290.1384958186@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Craig Ringer <craig(at)2ndquadrant(dot)com> writes:
> I'm spending a lot of time staring at parse and plan trees at the
> moment, and I'm finding reading them rather cumbersome.

Is there a particular reason you're doing that rather than looking at
EXPLAIN output? Only the latter is meant to be at all user-friendly.

> For those of you who do this a lot, do you use any sort of tooling to
> help you out? Just being able to collapse and expand subtrees would be a
> lifesaver.

vim was mentioned --- I prefer emacs, which can also find the matching
brace pretty easily.

> If it's a hassle for others too, how would you feel about using json as
> an output format in future releases? It'd be pretty simple to retrofit
> by the looks, though updating the regression tests would be a PITA. My
> main concern would be effects on back-patching.

The internal trees appear nowhere in the regression test outputs AFAIK.

> The same representation is used for storing rules. So it can't be
> changed for BC reasons and compactness/performance.

We could in principle change to a different text representation for
stored rules. Compactness would be an issue if it were materially
bigger than the existing formatting, but offhand it seems like JSON
is morally equivalent to what we do now, no?

If you think this is worthwhile, you might care to take a look at
outfuncs.c/readfuncs.c and figure out what it'd take to switch to
json-compatible formatting.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2013-11-20 14:53:20 Re: Data corruption issues using streaming replication on 9.0.14/9.2.5/9.3.1
Previous Message Boszormenyi Zoltan 2013-11-20 14:29:57 Followup patches for ECPG readahead, was: Re: ECPG FETCH readahead