Re: Understanding EXPLAIN ANALYZE output

Поиск
Список
Период
Сортировка
От Michael Fuhr
Тема Re: Understanding EXPLAIN ANALYZE output
Дата
Msg-id 20050210034123.GA58444@winnie.fuhr.org
обсуждение исходный текст
Ответ на Re: Understanding EXPLAIN ANALYZE output  (David Fetter <david@fetter.org>)
Ответы Re: Understanding EXPLAIN ANALYZE output  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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/

В списке pgsql-general по дате отправления:

Предыдущее
От: "Ed L."
Дата:
Сообщение: Re: Understanding EXPLAIN ANALYZE output
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: What talk would get you to go to OSCon?