Re: Rationalizing EXPLAIN VERBOSE output

From: Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Rationalizing EXPLAIN VERBOSE output
Date: 2002-03-11 05:22:50
Message-ID: Pine.LNX.4.21.0203111554240.27056-100000@linuxworld.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, 10 Mar 2002, Bruce Momjian wrote:

> Tom Lane wrote:

> > Seems kinda ugly. But maybe same idea with repeated VERBOSE,
> > a la some Unix commands ("more -v's get you more detail"):
> >
> > EXPLAIN [ANALYZE] [VERBOSE] [ VERBOSE ... ] statement;
> >

>
> I was never a fan of the -v -v more-verbose options, and I don't see any
> case where we use such behavior in our code. We do use detail levels
> for debug, and that is fairly common.

I agree. This is fine under Unix, but command arguments are not really a
grammar. Yacc doesn't enjoy terminal repetition and for good reason: it
usually suggests a clumsy grammar.

Personally, I think that Tom's code should go into standard EXPLAIN.

As for how to returning explain data as a SELECT. I think I prefer
Oracle's idea of output tables with a Postgres twist. EXPLAIN could then
be something like:

EXPLAIN [VERBOSE] [SET ID='...' ] [INTO [TEMP] <table>] <query>

If 'table' exists, EXPLAIN would check if it is a valid explain output
table (correct attr names, types) and if so insert the results of explain,
one tuple per line of output. ID would be a text identifier of the output.

If the table didn't exist, it would be created. TEMP means that the table
is removed at the end of the session.

Is this overkill?

Gavin

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Lockhart 2002-03-11 05:23:42 Re: Rationalizing EXPLAIN VERBOSE output
Previous Message Bruce Momjian 2002-03-11 05:21:29 Re: Rationalizing EXPLAIN VERBOSE output