Unix Technical Forum

postgresql Explain command output

This is a discussion on postgresql Explain command output within the Pgsql Performance forums, part of the PostgreSQL category; --> hi, is there any generalized format for the output for the output of the explain command ?. If so ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > Pgsql Performance

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-19-2008, 11:45 AM
RaviRam Kolipaka
 
Posts: n/a
Default postgresql Explain command output

hi,

is there any generalized format for the output for the output of the
explain command ?. If so please send that generalized format to me.
otherwise tell me how to parse the output of explain command to
know where the relation name occurs,where the conditions occurs,
where the join conditions occur and so on. My goal is create a visual
representation of the expain plan. Can some body help me in this regard.
Thanks & regards
RAVIRAM KOLIPAKA
M.TECH(CSE)-final year
IIIT Hyderabad

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-19-2008, 11:45 AM
Greg Smith
 
Posts: n/a
Default Re: postgresql Explain command output

On Thu, 6 Mar 2008, RaviRam Kolipaka wrote:

> My goal is create a visual representation of the expain plan.


This problem has been solved already by code that's in pgadmin and you
might look at that source code for hints if you want to write your own
implementation. There's a good intro to using that at
http://www.postgresonline.com/journa...ain-Plans.html

--
* Greg Smith gsmith@gregsmith.com http://www.gregsmith.com Baltimore, MD

--
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://mail.postgresql.org/mj/mj_www...ql-performance

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-19-2008, 11:45 AM
Tom Lane
 
Posts: n/a
Default Re: postgresql Explain command output

Greg Smith <gsmith@gregsmith.com> writes:
> On Thu, 6 Mar 2008, RaviRam Kolipaka wrote:
>> My goal is create a visual representation of the expain plan.


> This problem has been solved already by code that's in pgadmin and you
> might look at that source code for hints if you want to write your own
> implementation.


It's been solved more than once actually --- Red Hat did a "Visual
Explain" tool several years ago, which is unmaintained now but still
available for download (http://sources.redhat.com/rhdb/). I've heard
that EDB picked it up and is now maintaining their own fork, but I
don't know the status of that for sure. That code is in Java, if it
makes a difference to you.

regards, tom lane

--
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://mail.postgresql.org/mj/mj_www...ql-performance

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-19-2008, 11:45 AM
Greg Smith
 
Posts: n/a
Default Re: postgresql Explain command output

On Thu, 6 Mar 2008, Tom Lane wrote:

> Red Hat did a "Visual Explain" tool several years ago, which is
> unmaintained now but still available for download
> (http://sources.redhat.com/rhdb/). I've heard that EDB picked it up and
> is now maintaining their own fork, but I don't know the status of that
> for sure.


I know I wrote this down somewhere...ah ha, it was in the MySQL
comparision paper:

Visual Explain, originally a RedHat component that has been kept current
and improved by Enterprise DB, comes bundled with the EnterpriseDB
Advanced Server package. It can be built to run against other PostgreSQL
installations using the source code to their Developer Studio package:
http://www.enterprisedb.com/products/download.do

--
* Greg Smith gsmith@gregsmith.com http://www.gregsmith.com Baltimore, MD

--
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://mail.postgresql.org/mj/mj_www...ql-performance

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 04-19-2008, 11:45 AM
RaviRam Kolipaka
 
Posts: n/a
Default Re: postgresql Explain command output

How do we know in the output of expain command table or constraint names
so that while parsing each line of the output
we can able to recognise them and build the pictorial representation. for
example if you consider the following output

EXPLAIN select * from table1,table2 where roll=id_no;
QUERY PLAN
----------------------------------------------------------------------
Hash Join (cost=29.12..59.31 rows=850 width=124)
Hash Cond: (table2.id_no = table1.roll)
-> Seq Scan on table2 (cost=0.00..18.50 rows=850 width=62)
-> Hash (cost=18.50..18.50 rows=850 width=62)
-> Seq Scan on table1 (cost=0.00..18.50 rows=850 width=62)

we can know the table name , just by seeing any string after ON
keyword . Like that how to recognise the other constraints and so on.

On Thu, Mar 6, 2008 at 12:24 PM, Devi <devi@visolve.com> wrote:

> Hi,
>
> I suppose the format depends on the query you serve. The following links
> will throw some light.
>
> http://www.postgresql.org/docs/8.1/s...l-explain.html
> http://www.postgresql.org/docs/7/static/c4888.htm
>
> Thanks
> DEVI.G
>
> ----- Original Message -----
> *From:* RaviRam Kolipaka <raviram.kolipaka@gmail.com>
> *To:* pgsql-performance@postgresql.org
> *Sent:* Thursday, March 06, 2008 11:40 AM
> *Subject:* [PERFORM] postgresql Explain command output
>
>
> hi,
>
> is there any generalized format for the output for the output of the
> explain command ?. If so please send that generalized format to me.
> otherwise tell me how to parse the output of explain command to
> know where the relation name occurs,where the conditions occurs,
> where the join conditions occur and so on. My goal is create a visual
> representation of the expain plan. Can some body help me in this regard.
> Thanks & regards
> RAVIRAM KOLIPAKA
> M.TECH(CSE)-final year
> IIIT Hyderabad
>
> ------------------------------
>
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.5.516 / Virus Database: 269.21.5/1314 - Release Date: 3/5/2008
> 6:38 PM
>
>


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 06:27 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com