Re: Understanding EXPLAIN ANALYZE output

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: David Fetter <david(at)fetter(dot)org>
Cc: "Ed L(dot)" <pgsql(at)bluepolka(dot)net>, Martijn van Oosterhout <kleptog(at)svana(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-general(at)postgresql(dot)org
Subject: Re: Understanding EXPLAIN ANALYZE output
Date: 2005-02-10 03:41:23
Message-ID: 20050210034123.GA58444@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Feb 09, 2005 at 06:31:11PM -0800, David Fetter wrote:
> On Wed, Feb 09, 2005 at 04:34:30PM -0700, Ed L. wrote:
> >
> > SELECT sql, op, index, relation, actual_first
> > FROM pg_explain_analyze('SELECT * FROM foo')
> > WHERE op = 'Index Scan'
> > AND actual_first > 1.0;
> >
> > Thankfully, I'm sure there are a lot of skilled postgresql'ers
> > just sitting around right now wishing they had something to do.
>
> Well, I'm a little bored; I've got tomorrow off, and this seems like
> it might be doable in the kind of high-level PL/Foo's with which I'm
> familiar. What would the returning rowtype for
> pg_explain_analyze(TEXT) be?

I started looking at this earlier. Is it even possible to get
EXPLAIN output via SPI (and thus the PLs' interfaces to SPI)? Or
would the function have to make a new connection to the database
and issue the EXPLAIN as an ordinary client? I suppose a proper
implementation would be written in C and would call the internal
functions that generate the output, but I was thinking about how
to do something simple in a higher-level PL.

As for the return type, I was going to look at explain_outNode()
in src/backend/commands/explain.c and get some ideas from there.

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2005-02-10 03:58:41 Re: What talk would get you to go to OSCon?
Previous Message Jonel Rienton 2005-02-10 03:22:54 Re: Postgresql and Macintosh