Re: Functions and query analysis - EXPLAIN - Mailing list pgsql-novice

From Andreas Kretschmer
Subject Re: Functions and query analysis - EXPLAIN
Date
Msg-id 20120210175431.GA13740@tux
Whole thread Raw
In response to Functions and query analysis - EXPLAIN  (Andy Halsall <halsall_andy@hotmail.com>)
List pgsql-novice
Andy Halsall <halsall_andy@hotmail.com> wrote:

> Is it possible to use EXPLAIN from inside a function? Have seen this post http:
> //archives.postgresql.org/pgsql-general/2011-04/msg00750.php but can't get it
> to work on even a simple query. Need it to work on a query in a function with a
> UNION.
>
> Perhaps there's a better way of determining if my function is using the indexes
> I'd like it to use?

Not sure if i understand you, but i think, you are looking for the
module AUTO_EXPLAIN. With this, and auto_explain.log_nested_statements =
on, you can see the explain-output in your log.


Andreas
--
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect.                              (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly."   (unknown)
Kaufbach, Saxony, Germany, Europe.              N 51.05082°, E 13.56889°

pgsql-novice by date:

Previous
From: Andy Halsall
Date:
Subject: Functions and query analysis - EXPLAIN
Next
From: Alessandro Gagliardi
Date:
Subject: insert fail gracefully if primary key already exists