Martin Pihlak <[EMAIL PROTECTED]> 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 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers