Re: contrib/pg_stat_statements - Mailing list pgsql-hackers

From ITAGAKI Takahiro
Subject Re: contrib/pg_stat_statements
Date
Msg-id 20081027163356.ADCD.52131E4D@oss.ntt.co.jp
Whole thread Raw
In response to Re: contrib/pg_stat_statements  (Martin Pihlak <martin.pihlak@gmail.com>)
Responses Re: contrib/pg_stat_statements
Re: contrib/pg_stat_statements
List pgsql-hackers
Martin Pihlak <martin.pihlak@gmail.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.

Regards,
---
ITAGAKI Takahiro
NTT Open Source Software Center




pgsql-hackers by date:

Previous
From: Ron Mayer
Date:
Subject: Re: new correlation metric
Next
From: ITAGAKI Takahiro
Date:
Subject: contrib/pg_stat_statements v2