0

I want to Tune my PostgreSQL stored procedure which has 1000 queries Inside. My SP is suddenly started to lack Perfomance. How can I debug this SP which query is lagging performance inside the SP? Since Explain analyze doesn’t really show the much stats on SP.

Thanks for you help out

Prasanth Reddy
  • 43
  • 1
  • 1
  • 3

1 Answers1

0

You best use auto_explain with auto_explain.log_nested_statements, auto_explain.log_analyze and auto_explain.log_buffers turned on.

Then you get the execution plans of all SQL statements with their duration logged.

I think that if you have a single function with 1000 different SQL statements inside, your design could be improved.

Laurenz Albe
  • 209,280
  • 17
  • 206
  • 263