Re: Invalid YAML output from EXPLAIN

From: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: Invalid YAML output from EXPLAIN
Date: 2010-06-09 19:38:10
Message-ID: AANLkTim4sNkHELcgYYrtVOflfIJb4hnQTZGX0At_vMJ7@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

On 9 June 2010 19:50, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> After thinking about this further, I think I'd still like to take one
> more crack at fixing this without quoting absolutely everything.  I
> argued against this feature, but we decided to take it, and it seems
> that one of the major arguments that is being put forward is that it
> will be more readable than JSON, because it will have less
> punctuation.

Hmm. Well it's quite subjective, but IMO it's already more readable
than JSON regardless of whether or not values are quoted, simply
because it doesn't have [ ] and { } for lists and maps, which for JSON
adds significantly to the number of lines in longer plans.

Compare

QUERY PLAN
----------------------------------------
- Plan: +
Node Type: Nested Loop +
Join Type: Inner +
Startup Cost: 0.00 +
Total Cost: 57313.15 +
Plan Rows: 4579600 +
Plan Width: 16 +
Plans: +
- Node Type: Seq Scan +
Parent Relationship: Outer +
Relation Name: foo +
Alias: f1 +
Startup Cost: 0.00 +
Total Cost: 31.40 +
Plan Rows: 2140 +
Plan Width: 8 +
- Node Type: Materialize +
Parent Relationship: Inner +
Startup Cost: 0.00 +
Total Cost: 42.10 +
Plan Rows: 2140 +
Plan Width: 8 +
Plans: +
- Node Type: Seq Scan +
Parent Relationship: Outer+
Relation Name: foo +
Alias: f2 +
Startup Cost: 0.00 +
Total Cost: 31.40 +
Plan Rows: 2140 +
Plan Width: 8

with
QUERY PLAN
-----------------------------------------------
[ +
{ +
"Plan": { +
"Node Type": "Nested Loop", +
"Join Type": "Inner", +
"Startup Cost": 0.00, +
"Total Cost": 57313.15, +
"Plan Rows": 4579600, +
"Plan Width": 16, +
"Plans": [ +
{ +
"Node Type": "Seq Scan", +
"Parent Relationship": "Outer", +
"Relation Name": "foo", +
"Alias": "f1", +
"Startup Cost": 0.00, +
"Total Cost": 31.40, +
"Plan Rows": 2140, +
"Plan Width": 8 +
}, +
{ +
"Node Type": "Materialize", +
"Parent Relationship": "Inner", +
"Startup Cost": 0.00, +
"Total Cost": 42.10, +
"Plan Rows": 2140, +
"Plan Width": 8, +
"Plans": [ +
{ +
"Node Type": "Seq Scan", +
"Parent Relationship": "Outer",+
"Relation Name": "foo", +
"Alias": "f2", +
"Startup Cost": 0.00, +
"Total Cost": 31.40, +
"Plan Rows": 2140, +
"Plan Width": 8 +
} +
] +
} +
] +
} +
} +
]

For me, the presence or absence of quotes around the values would make
little difference to the readability, compared to all those brackets.

> While the idea of optimizing a machine-readable format
> for human-readability doesn't typically carry much water around here,
> it's really the only use case for having this particular feature at
> all, so, if we're not going to rip it out, ISTM we ought to respect
> what it's there for.  I would be more than willing to agree that if
> one more attempt isn't sufficient to fix the problem then we'll either
> quote everything, or rip the whole thing out.
>
> --
> Robert Haas
> EnterpriseDB: http://www.enterprisedb.com
> The Enterprise Postgres Company
>

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2010-06-09 19:50:47 Re: Invalid YAML output from EXPLAIN
Previous Message Kevin Grittner 2010-06-09 18:56:13 Re: BUG #5495: RI/FK on self and inherited table

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2010-06-09 19:47:55 Re: No hash join across partitioned tables?
Previous Message Robert Haas 2010-06-09 19:32:58 Re: failover vs. read only queries