Thread: Export the explain diagram?

Export the explain diagram?

From
"Michael Shapiro"
Date:
I would love to be be able to capture the diagram created by explain into an image file (e.g. jpg). I don't see any way
todo that in PgAdmin. I could use an external tool, but none of the tools I have found can handle scrolling in the
horizontaldirection (which occurs often in the diagrams). <br /><br />Are they are plans to add such an export
capability?<br/> 

Re: Export the explain diagram?

From
"Dave Page"
Date:

> ------- Original Message -------
> From: "Michael Shapiro" <mshapiro51@gmail.com>
> To: "pgAdmin Support" <pgadmin-support@postgresql.org>
> Sent: 13/09/07, 14:01:37
> Subject: [pgadmin-support] Export the explain diagram?
> 
> I would love to be be able to capture the diagram created by explain into an
> image file (e.g. jpg). I don't see any way to do that in PgAdmin. I could
> use an external tool, but none of the tools I have found can handle
> scrolling in the horizontal direction (which occurs often in the diagrams).
> 
> Are they are plans to add such an export capability?

No, noone ever asked for it before. It's a sensible addition though, so if anyone wants to come up with a patch.

/D


Re: Export the explain diagram?

From
Charlie Clark
Date:
Am 15.09.2007 um 09:46 schrieb Dave Page:

> No, noone ever asked for it before. It's a sensible addition
> though, so if anyone wants to come up with a patch.

I would have thought SVG would be a good choice for the export
format. How is the layouting done?

Charlie
--
Charlie Clark
Helmholtzstr. 20
Düsseldorf
D- 40215
Tel: +49-211-938-5360
GSM: +49-178-782-6226





Re: Export the explain diagram?

From
Magnus Hagander
Date:
Dave Page wrote:
> 
>> ------- Original Message -------
>> From: "Michael Shapiro" <mshapiro51@gmail.com>
>> To: "pgAdmin Support" <pgadmin-support@postgresql.org>
>> Sent: 13/09/07, 14:01:37
>> Subject: [pgadmin-support] Export the explain diagram?
>>
>> I would love to be be able to capture the diagram created by explain into an
>> image file (e.g. jpg). I don't see any way to do that in PgAdmin. I could
>> use an external tool, but none of the tools I have found can handle
>> scrolling in the horizontal direction (which occurs often in the diagrams).
>>
>> Are they are plans to add such an export capability?
> 
> No, noone ever asked for it before. It's a sensible addition though, so if anyone wants to come up with a patch.

Are you sure I didn't ask you for that before? ;-) I meant to :-P

If nobody else does it, I'll try to work on this for the next release.

//Magnus


Re: Export the explain diagram?

From
Dave Page
Date:
Charlie Clark wrote:
> 
> Am 15.09.2007 um 09:46 schrieb Dave Page:
> 
>> No, noone ever asked for it before. It's a sensible addition though,
>> so if anyone wants to come up with a patch.
> 
> I would have thought SVG would be a good choice for the export format.
> How is the layouting done?

It's drawn programmatically using wxOGL.

Regards, Dave


Re: Export the explain diagram?

From
Dave Page
Date:
Magnus Hagander wrote:
> Dave Page wrote:
>>> ------- Original Message -------
>>> From: "Michael Shapiro" <mshapiro51@gmail.com>
>>> To: "pgAdmin Support" <pgadmin-support@postgresql.org>
>>> Sent: 13/09/07, 14:01:37
>>> Subject: [pgadmin-support] Export the explain diagram?
>>>
>>> I would love to be be able to capture the diagram created by explain into an
>>> image file (e.g. jpg). I don't see any way to do that in PgAdmin. I could
>>> use an external tool, but none of the tools I have found can handle
>>> scrolling in the horizontal direction (which occurs often in the diagrams).
>>>
>>> Are they are plans to add such an export capability?
>> No, noone ever asked for it before. It's a sensible addition though, so if anyone wants to come up with a patch.
> 
> Are you sure I didn't ask you for that before? ;-) I meant to :-P

Not that I ever recall.

> If nobody else does it, I'll try to work on this for the next release.

Thanks.

/D



Re: Export the explain diagram?

From
"Michael Shapiro"
Date:
I found these error messages in the pgadmin.log file.<br />I am running 1.8.0 (rev 6766:6767)<br /><br />2007-11-03
08:51:00ERROR  : Can't create window of class wxWindowClass (error 14: not enough storage is available to complete this
operation.)<br />2007-11-03 08:51:00 ERROR  : Can't create window of class wxWindowClassNR (error 14: not enough
storageis available to complete this operation.)<br />2007-11-03 08:51:00 ERROR  : Can't create dialog using memory
template(error 14: not enough storage is available to complete this operation.) <br />2007-11-03 08:52:02 ERROR  :
Failedto put data on the clipboard (error -2147467259: unspecified error)<br />2007-11-03 08:52:04 ERROR  : Can't
createwindow of class wxWindowClassNR (error 14: not enough storage is available to complete this operation.) <br
/>2007-11-0308:52:04 ERROR  : Can't create window of class wxWindowClassNR (error 14: not enough storage is available
tocomplete this operation.)<br />2007-11-03 08:52:04 ERROR  : Failed to create a status bar. (error 1406: cannot create
atop-level child window.) <br />2007-11-03 08:52:04 ERROR  : Can't create window of class wxWindowClassNR (error 1406:
cannotcreate a top-level child window.)<br />2007-11-03 08:52:27 ERROR  : Can't create window of class wxWindowClass
(error14: not enough storage is available to complete this operation.) <br />2007-11-03 08:52:27 ERROR  : Can't create
windowof class wxWindowClassNR (error 14: not enough storage is available to complete this operation.)<br />2007-11-03
08:52:27ERROR  : Can't create dialog using memory template (error 14: not enough storage is available to complete this
operation.)<br /><br /> 

Re: Export the explain diagram?

From
Dave Page
Date:
Michael Shapiro wrote:
> I found these error messages in the pgadmin.log file.
> I am running 1.8.0 (rev 6766:6767)
> 
> 2007-11-03 08:51:00 ERROR  : Can't create window of class wxWindowClass 
> (error 14: not enough storage is available to complete this operation.)

There is no option to export the explain diagram in the standard version 
of pgAdmin. Are you sure you haven't found a fork somewhere?

Regards, Dave


Re: Export the explain diagram?

From
Michael Shapiro
Date:
I'd like to revive a feature request I made about 2 years ago ...<br /><br /><div class="gmail_quote">On Thu, Sep 13,
2007at 7:01 AM, Michael Shapiro <span dir="ltr"><<a
href="mailto:mshapiro51@gmail.com">mshapiro51@gmail.com</a>></span>wrote:<br /><blockquote class="gmail_quote"
style="border-left:1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">I would love to be be
ableto capture the diagram created by explain into an image file (e.g. jpg). I don't see any way to do that in PgAdmin.
Icould use an external tool, but none of the tools I have found can handle scrolling in the horizontal direction (which
occursoften in the diagrams). <br /><br />Are they are plans to add such an export capability?<br
/></blockquote></div><br/> 

Re: Export the explain diagram?

From
Guillaume Lelarge
Date:
Le 09/02/2010 13:02, Michael Shapiro a écrit :
> I'd like to revive a feature request I made about 2 years ago ...
> 

Ashesh did some work on it. He sent a really interesting patch which
allow a user to print and save the explain analyze. AFAICT, it seems I
forgot to read the patch. I tried it and it worked OK. I'll try to push
this forward.


-- 
Guillaume.http://www.postgresqlfr.orghttp://dalibo.com


Re: Export the explain diagram?

From
Guillaume Lelarge
Date:
Le 09/02/2010 14:30, Michael Shapiro a écrit :
> I don't think this is what I was asking for. I want the image from the
> "normal" (as opposed to "Analyze" or "Verbose"). The "Analyze" and
> "Verbose" do not produce a diagram. Does Ashesh's work produce an image like
> what the normal explain does?
> 

The ANALYZE option already does. The VERBOSE one doesn't, but will do in
a patch I'm working on.


-- 
Guillaume.http://www.postgresqlfr.orghttp://dalibo.com


Re: Export the explain diagram?

From
Michael Shapiro
Date:
My mistake. I do see the diagram. What is the difference between explain without Analyze or Verbose selected? (That is how I normally run it, ie I don't select Analyze or Verbose from the Query menu, I just run explain and I get a diagram).

On Tue, Feb 9, 2010 at 7:43 AM, Guillaume Lelarge <guillaume@lelarge.info> wrote:
Le 09/02/2010 14:30, Michael Shapiro a écrit :
> I don't think this is what I was asking for. I want the image from the
> "normal" (as opposed to "Analyze" or "Verbose"). The "Analyze" and
> "Verbose" do not produce a diagram. Does Ashesh's work produce an image like
> what the normal explain does?
>

The ANALYZE option already does. The VERBOSE one doesn't, but will do in
a patch I'm working on.


--

Re: Export the explain diagram?

From
Guillaume Lelarge
Date:
Le 09/02/2010 14:49, Michael Shapiro a écrit :
> My mistake. I do see the diagram. What is the difference between explain
> without Analyze or Verbose selected? (That is how I normally run it, ie I
> don't select Analyze or Verbose from the Query menu, I just run explain and
> I get a diagram).
> 

You have less informations on each node when you click on them if you
asked for a VACUUM without options. For example, on a VACUUM with the
ANALYZE option, you'll get the real cost, the real number of rows
returned, etc.)


-- 
Guillaume.http://www.postgresqlfr.orghttp://dalibo.com


Re: Export the explain diagram?

From
Guillaume Lelarge
Date:
Le 09/02/2010 15:09, Michael Shapiro a écrit :
> We are talking about EXPLAIN, not VACUUM, since this is from the Query tool.
> 

Sorry, I meant EXPLAIN when I said VACUUM. Should sleep more :)

> Is there a lot more information in the EXPLAIN diagram with ANALYZE than
> without it?
> 

A lot, not really. More useful than a "simple" EXPLAIN, sure.


-- 
Guillaume.http://www.postgresqlfr.orghttp://dalibo.com


Re: Export the explain diagram?

From
Michael Shapiro
Date:
The diagram looks pretty much the same, but I do see that when I click on one of the items in the diagram, the text box that pops up showing info from the explain (cost, etc) has more to it (not just cost, but actual time). I assume that information is coming from the more extensive information from the ANALYZE. Nice! It takes a bit longer to run the EXPLAIN with ANALYZE turned on, but it is worth it.

I have a another request for a mod to the diagram. The text box disappears as soon as I move the mouse. It would be helpful if it would stay up longer (eg, until the mouse is clicked in the text box).  In order to compare various queries, it is helpful to be able to see the info from two diagrams at the same time. What would make this possible is if the text boxes were to stay up until I click again.

On Tue, Feb 9, 2010 at 8:24 AM, Guillaume Lelarge <guillaume@lelarge.info> wrote:
Le 09/02/2010 15:09, Michael Shapiro a écrit :
> We are talking about EXPLAIN, not VACUUM, since this is from the Query tool.
>

Sorry, I meant EXPLAIN when I said VACUUM. Should sleep more :)

> Is there a lot more information in the EXPLAIN diagram with ANALYZE than
> without it?
>

A lot, not really. More useful than a "simple" EXPLAIN, sure.


--

Re: Export the explain diagram?

From
Guillaume Lelarge
Date:
Le 09/02/2010 15:48, Michael Shapiro a écrit :
> The diagram looks pretty much the same, but I do see that when I click on
> one of the items in the diagram, the text box that pops up showing info from
> the explain (cost, etc) has more to it (not just cost, but actual time). I
> assume that information is coming from the more extensive information from
> the ANALYZE. Nice! It takes a bit longer to run the EXPLAIN with ANALYZE
> turned on, but it is worth it.
> 

It takes longer because it really executes the query.

> I have a another request for a mod to the diagram. The text box disappears
> as soon as I move the mouse. It would be helpful if it would stay up longer
> (eg, until the mouse is clicked in the text box).  In order to compare
> various queries, it is helpful to be able to see the info from two diagrams
> at the same time. What would make this possible is if the text boxes were to
> stay up until I click again.
> 

It could be interesting to do. Anyways, you can also compare the text
output.


-- 
Guillaume.http://www.postgresqlfr.orghttp://dalibo.com


Re: Export the explain diagram?

From
Michael Shapiro
Date:
On Tue, Feb 9, 2010 at 9:03 AM, Guillaume Lelarge <guillaume@lelarge.info> wrote:

> I have a another request for a mod to the diagram. The text box disappears
> as soon as I move the mouse. It would be helpful if it would stay up longer
> (eg, until the mouse is clicked in the text box).  In order to compare
> various queries, it is helpful to be able to see the info from two diagrams
> at the same time. What would make this possible is if the text boxes were to
> stay up until I click again.
>

It could be interesting to do. Anyways, you can also compare the text output.

Yes, true, but then why bother with the diagram. The advantage of the diagram (and it is a big one) is that it is a lot easier to see what is going on. Comparing the texts of explain output is pretty nasty ...


Re: Export the explain diagram?

From
Michael Shapiro
Date:
As long as JPG is also supported. You might want to offer a Save As where SVG, PNG, JPG, BMP(?) are offered.

On Tue, Feb 9, 2010 at 10:46 AM, Andreas Neumann <a.neumann@carto.net> wrote:
If someone works on exporting the diagram, it would be worth looking at
the SVG format, which is supported by modern browsers.

This way it can be read into Inkscape as well for further processing.

And it could potentially also contain scripting/interactivity for tooltips.

Andreas


On Tue, February 9, 2010 3:48 pm, Michael Shapiro wrote:
> The diagram looks pretty much the same, but I do see that when I click on
> one of the items in the diagram, the text box that pops up showing info
> from
> the explain (cost, etc) has more to it (not just cost, but actual time). I
> assume that information is coming from the more extensive information from
> the ANALYZE. Nice! It takes a bit longer to run the EXPLAIN with ANALYZE
> turned on, but it is worth it.
>
> I have a another request for a mod to the diagram. The text box disappears
> as soon as I move the mouse. It would be helpful if it would stay up
> longer
> (eg, until the mouse is clicked in the text box).  In order to compare
> various queries, it is helpful to be able to see the info from two
> diagrams
> at the same time. What would make this possible is if the text boxes were
> to
> stay up until I click again.
>
> On Tue, Feb 9, 2010 at 8:24 AM, Guillaume Lelarge
> <guillaume@lelarge.info>wrote:
>
>> Le 09/02/2010 15:09, Michael Shapiro a écrit :
>> > We are talking about EXPLAIN, not VACUUM, since this is from the Query
>> tool.
>> >
>>
>> Sorry, I meant EXPLAIN when I said VACUUM. Should sleep more :)
>>
>> > Is there a lot more information in the EXPLAIN diagram with ANALYZE
>> than
>> > without it?
>> >
>>
>> A lot, not really. More useful than a "simple" EXPLAIN, sure.
>>
>>
>> --
>> Guillaume.
>>  http://www.postgresqlfr.org
>>  http://dalibo.com
>>
>


--
Andreas Neumann
http://www.carto.net/neumann/
http://www.svgopen.org/


Re: Export the explain diagram?

From
"Andreas Neumann"
Date:
If someone works on exporting the diagram, it would be worth looking at
the SVG format, which is supported by modern browsers.

This way it can be read into Inkscape as well for further processing.

And it could potentially also contain scripting/interactivity for tooltips.

Andreas


On Tue, February 9, 2010 3:48 pm, Michael Shapiro wrote:
> The diagram looks pretty much the same, but I do see that when I click on
> one of the items in the diagram, the text box that pops up showing info
> from
> the explain (cost, etc) has more to it (not just cost, but actual time). I
> assume that information is coming from the more extensive information from
> the ANALYZE. Nice! It takes a bit longer to run the EXPLAIN with ANALYZE
> turned on, but it is worth it.
>
> I have a another request for a mod to the diagram. The text box disappears
> as soon as I move the mouse. It would be helpful if it would stay up
> longer
> (eg, until the mouse is clicked in the text box).  In order to compare
> various queries, it is helpful to be able to see the info from two
> diagrams
> at the same time. What would make this possible is if the text boxes were
> to
> stay up until I click again.
>
> On Tue, Feb 9, 2010 at 8:24 AM, Guillaume Lelarge
> <guillaume@lelarge.info>wrote:
>
>> Le 09/02/2010 15:09, Michael Shapiro a écrit :
>> > We are talking about EXPLAIN, not VACUUM, since this is from the Query
>> tool.
>> >
>>
>> Sorry, I meant EXPLAIN when I said VACUUM. Should sleep more :)
>>
>> > Is there a lot more information in the EXPLAIN diagram with ANALYZE
>> than
>> > without it?
>> >
>>
>> A lot, not really. More useful than a "simple" EXPLAIN, sure.
>>
>>
>> --
>> Guillaume.
>>  http://www.postgresqlfr.org
>>  http://dalibo.com
>>
>


-- 
Andreas Neumann
http://www.carto.net/neumann/
http://www.svgopen.org/



Re: Export the explain diagram?

From
Guillaume Lelarge
Date:
Le 09/02/2010 17:52, Michael Shapiro a écrit :
> As long as JPG is also supported. You might want to offer a Save As where
> SVG, PNG, JPG, BMP(?) are offered.
> 

IIRC, only JPG is currently supported.


-- 
Guillaume.http://www.postgresqlfr.orghttp://dalibo.com


Re: Export the explain diagram?

From
Guillaume Lelarge
Date:
Le 09/02/2010 23:05, Michael Shapiro a écrit :
> Any idea when it might be available?
> 

If it gets commited soon, it would be available for 1.12, which means
some time before PostgreSQL 9.0.


-- 
Guillaume.http://www.postgresqlfr.orghttp://dalibo.com