Re: machine-readable explain output v4

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Csaba Nagy <nagy(at)ecircle-ag(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Mike <ipso(at)snappymail(dot)ca>, Andres Freund <andres(at)anarazel(dot)de>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Itagaki Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
Subject: Re: machine-readable explain output v4
Date: 2009-08-12 15:25:57
Message-ID: 4A82DF05.1040703@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Alvaro Herrera wrote:
> Andrew Dunstan escribió:
>
>
>> STATEMENT: SELECT 1 AS one;
>> LOG: duration: 0.008 ms plan:
>> <Plan>
>> <Node-Type>Result</Node-Type>
>> <Startup-Cost>0.00</Startup-Cost>
>> <Total-Cost>0.01</Total-Cost>
>> <Plan-Rows>1</Plan-Rows>
>> <Plan-Width>0</Plan-Width>
>> </Plan>
>>
>
> I think what this says is that auto-explain should not be sending its
> output to the regular logfile, but somewhere else. The format you show
> above is not the most usable thing in the world -- not for machine
> parsing, and neither for human consumption.
>
> Maybe it should fill its own file with something like this:
>
> <autoexplain>
> <query>select 1 as one;</query>
> <duration>0.008</duration>
> <Plan>
> <Node-Type>Result</Node-Type>
> <Startup-Cost>0.00</Startup-Cost>
> <Total-Cost>0.01</Total-Cost>
> <Plan-Rows>1</Plan-Rows>
> <Plan-Width>0</Plan-Width>
> </Plan>
> </autoexplain>
>
> or some such.
>
>

With a format like this, pulling them out of the log file would be
trivial, so I don't see why it couldn't go in the log file.

It needs a bit of tweaking, but the idea is right.

And to answer Robert's question - yes, I will be submitting a patch or
two in due course.

cheers

andrew

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Stark 2009-08-12 15:28:40 Re: expanding our usage of POSIX_FADVISE
Previous Message Alvaro Herrera 2009-08-12 15:24:17 Re: WIP: getting rid of the pg_database flat file