Mike Nolan wrote:
Maybe you could return a refcursor pointing to the EXPLAIN ANALYZE of
the query inside the function.
The raw materials exist to do this: if you know which elements of a
query will be replaced by plpgsql variables, you can duplicate the
results via
PREPARE foo(...) AS ...
"Joshua D. Drake" <[EMAIL PROTECTED]> writes:
> Mike Nolan wrote:
>> That part I get, but I cannot seem to get an 'explain select' to return
>> the explain output inside a function.
> Oh interesting. Hmmm. Alvaro can you think of a way to execute the
> result into a variable and return it as
Mike Nolan wrote:
Mike Nolan wrote:
select * from foo('bar','debug')
But how do I do that inside a pl/pgsql function? 'select into' doesn't
seem to work properly.
You would have to code it. For example:
IF $2 = ''debug'' THEN:
That part I get, but I cannot seem to get an 'explain select' to
> Mike Nolan wrote:
> >>select * from foo('bar','debug')
> >
> >
> > But how do I do that inside a pl/pgsql function? 'select into' doesn't
> > seem to work properly.
>
>
> You would have to code it. For example:
>
> IF $2 = ''debug'' THEN:
That part I get, but I cannot seem to get an 'expla
Mike Nolan wrote:
select * from foo('bar','debug')
But how do I do that inside a pl/pgsql function? 'select into' doesn't
seem to work properly.
You would have to code it. For example:
IF $2 = ''debug'' THEN:
I would have to check be able to include a timestamp at the beginning
of each notice
> > Maybe you could return a refcursor pointing to the EXPLAIN ANALYZE of
> > the query inside the function.
>
> The raw materials exist to do this: if you know which elements of a
> query will be replaced by plpgsql variables, you can duplicate the
> results via
>
> PREPARE foo(...) AS ...
Alvaro Herrera <[EMAIL PROTECTED]> writes:
> On Fri, Apr 29, 2005 at 12:32:26PM -0500, Mike Nolan wrote:
>> Any ideas on how to tune a user function?
> Maybe you could return a refcursor pointing to the EXPLAIN ANALYZE of
> the query inside the function.
The raw materials exist to do this: if you
We have functions with upwards of 800 lines and we simply pull the queries
out and stick them in the PG Lighting Admin or PG Admin III query editor. We
then substitue any vars etc with real values. Works ok.
> What's the best way to tune the queries inside a user function?
>
> I have a fairl
> select * from foo('bar','debug')
But how do I do that inside a pl/pgsql function? 'select into' doesn't
seem to work properly.
> I would have to check be able to include a timestamp at the beginning
> of each notice.
You can do that from the config file, but it only gives the time to the
ne
Huh, sorry, this doesn't work ... we don't allow DECLARE for EXPLAIN.
It'd be neat though ...
What about having a debug mode for the function. E.g:
selet * from foo('bar','debug')
When you run with debug it actually runs the function but outputs
notices that are the explain anaylze of each function
On Fri, Apr 29, 2005 at 02:38:30PM -0400, Alvaro Herrera wrote:
> On Fri, Apr 29, 2005 at 12:32:26PM -0500, Mike Nolan wrote:
>
> > I need to find out if the function can be tuned further, but 'explain'
> > doesn't really tell much about what's happening inside the function.
> >
> > Any ideas on
On Fri, Apr 29, 2005 at 12:32:26PM -0500, Mike Nolan wrote:
> I need to find out if the function can be tuned further, but 'explain'
> doesn't really tell much about what's happening inside the function.
>
> Any ideas on how to tune a user function?
Maybe you could return a refcursor pointing to
12 matches
Mail list logo