Re: understanding explain data

From: Richard Huxton <dev(at)archonet(dot)com>
To: Alban Hertroys <alban(at)magproductions(dot)nl>
Cc: Sim Zacks <sim(at)compulab(dot)co(dot)il>, pgsql-general(at)postgresql(dot)org
Subject: Re: understanding explain data
Date: 2006-05-10 20:00:02
Message-ID: 44624642.1060104@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Alban Hertroys wrote:
> Sim Zacks wrote:
>> Something such as: with this explain data, adding an index on table
>> tbl column A would drastically improve the efficiency. Or at least an
>> application that would say, the least efficient part of your query is
>> on this part of the code so that you could more easily figure out what
>> to do about it.
>
> The latter part is the most useful IMO, optimizing usually needs a
> (human) brain to put things into the right perspective. Adding an index
> can speed up your queries only so much, a more optimal data presentation
> (like moving calculations to insert/update instead of select) can do a
> lot more sometimes.
>
> It looks like something like that shouldn't be too hard to write...
> Maybe it even does exist already. Personally I'd prefer a command line
> tool ;)
> It would help if you can pipe the output of explain analyze to an
> external tool from within psql.

I've got a short perl script that I throw explain output into. It's not
brilliant - can give false positives, but it will usually give you two
or three lines to look at.

For those that are interested, I've attached it.

--
Richard Huxton
Archonet Ltd

Attachment Content-Type Size
parse_explain.pl application/x-perl 554 bytes

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bob Pawley 2006-05-10 22:04:23 Re: Interface
Previous Message Frank L. Parks 2006-05-10 19:30:27 Re: Interface