Martin Pihlak <martin(dot)pihlak(at)gmail(dot)com> wrote:
> ITAGAKI Takahiro wrote:
> > I'd like to submit pg_stat_statements contrib module
> Nice work! There is one feature I'd like to request -- we need to be able
> to also track nested statements. This would greatly simplify diagnosing
> performance problems in complex stored procedures. Perhaps the GUC
> track_statements could be made an enum - none, top, all?
I tried your request, but found it's hard to determine query text
where the executing plan comes. We can get the query text from
ActivePortal->sourceText only for top statements. Stored procedures
doesn't use portals and uses executor directly.
It might be possbile to add a queryText field into QueryDesc
and all of the codes using QueryDesc initialize the field with
their own query texts, but it requires modifications in many
different modules and copying query text might be needed.
I don't want to do it only for this contrib module,
so I'll support only top statements at the moment. Sorry.
NTT Open Source Software Center
In response to
pgsql-hackers by date
|Next:||From: ITAGAKI Takahiro||Date: 2008-10-27 08:40:45|
|Subject: contrib/pg_stat_statements v2|
|Previous:||From: Ron Mayer||Date: 2008-10-27 07:27:44|
|Subject: Re: new correlation metric|