Thread: How Do You Associate a Query With its Invoking Procedure?
In API function may invoke 10 queries. Ideally, I would like to know what queries are invoked by it and how long each took.
I’m using pg_stat_statement. I can see the API function statement, but how do I deterministically identify all queries invoked by it?
----------------
Thank you
In API function may invoke 10 queries. Ideally, I would like to know what queries are invoked by it and how long each took.
I’m using pg_stat_statement. I can see the API function statement, but how do I deterministically identify all queries invoked by it?
----------------
Thank you
In API function may invoke 10 queries. Ideally, I would like to know what queries are invoked by it and how long each took.
I’m using pg_stat_statement. I can see the API function statement, but how do I deterministically identify all queries invoked by it?
In API function may invoke 10 queries. Ideally, I would like to know what queries are invoked by it and how long each took.
I’m using pg_stat_statement. I can see the API function statement, but how do I deterministically identify all queries invoked by it?
pg_stat_statement is a global tracker that throws away execution context, in this case the process id, needed to track the level of detail you desire. I think the best you can do is log all statements and durations to the log file and parse that.
On Sep 13, 2018, at 21:49, Fd Habash <fmhabash@gmail.com> wrote:In API function may invoke 10 queries. Ideally, I would like to know what queries are invoked by it and how long each took.I’m using pg_stat_statement. I can see the API function statement, but how do I deterministically identify all queries invoked by it?----------------
Thank you
Patrick
Any ideas, please?On Thu, Sep 13, 2018, 3:49 PM Fd Habash <fmhabash@gmail.com> wrote:In API function may invoke 10 queries. Ideally, I would like to know what queries are invoked by it and how long each took.
I’m using pg_stat_statement. I can see the API function statement, but how do I deterministically identify all queries invoked by it?
----------------
Thank you
You might find application-level tracing a more practical answer - e.g. check out Datadog APM for a (commercial) plug and play approach or Jaeger for a self-hostable option.
PatrickOn Fri, Sep 14, 2018 at 4:38 PM Fred Habash <fmhabash@gmail.com> wrote:Any ideas, please?On Thu, Sep 13, 2018, 3:49 PM Fd Habash <fmhabash@gmail.com> wrote:In API function may invoke 10 queries. Ideally, I would like to know what queries are invoked by it and how long each took.
I’m using pg_stat_statement. I can see the API function statement, but how do I deterministically identify all queries invoked by it?
----------------
Thank you