Understand time taken by individual SQL statements in a procedure

From: Satalabaha Postgres <satalabaha(dot)postgres(at)gmail(dot)com>
To: pgsql-performance(at)lists(dot)postgresql(dot)org
Subject: Understand time taken by individual SQL statements in a procedure
Date: 2023-06-03 07:18:37
Message-ID: CAJ_W8nYO2K2Q2CNU=Cy_yVqOdeaY_fSyWyn0Rt_bBG=JMEfbfQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Hi Listers,

We would like to determine how long it takes for each SQL statement to
execute within a long-running procedure. I tried to see if
pg_stat_statements could offer any insight into the matter. But I was
unable to locate any. Is this even possible? How can we also determine the
precise SQL execution plan used when a SQL is run from an application? The
query runs without issue when we try to execute it directly, but it takes
longer to run when an application is used.

Regards,

Satalabha

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Julien Rouhaud 2023-06-03 07:36:04 Re: Understand time taken by individual SQL statements in a procedure
Previous Message Jeff Janes 2023-06-02 19:17:13 Re: thousands of CachedPlan entry per backend