On 1/23/26 11:47 AM, KK CHN wrote:
You mean to say the SQL statements are making this issue ? I also
suspected wrongly formed query statements making this much load on the
DB server.
I also suspect this, as the developers who write queries are not so
expertised for writing optimized queries, needs to be addressed separately.
How can I find out which query statements are making the DB server on
its knees ? Any method to find the bad queries? what parameters/
behaviours to be checked for finding those query statements which really
makes the db server to its knees by the heavy lifting ? any hints
most welcome, I can explore and fix those ones.
For log settings that deal with statements, take a look at:
https://www.postgresql.org/docs/16/runtime-config-logging.html#RUNTIME-CONFIG-LOGGING-WHEN
and
https://www.postgresql.org/docs/16/runtime-config-logging.html#RUNTIME-CONFIG-LOGGING-WHAT
There is also, for viewing statistics on current activity:
https://www.postgresql.org/docs/16/monitoring-stats.html#MONITORING-STATS-VIEWS
For another view of statistics see the extension:
https://www.postgresql.org/docs/16/pgstatstatements.html
In particular:
https://www.postgresql.org/docs/16/monitoring-stats.html#MONITORING-PG-STAT-ACTIVITY-VIEW
Also for lock activity:
https://www.postgresql.org/docs/16/view-pg-locks.html
Sorry I missed to mention it, this is an EDB 16 server. Eventhoug I
prefer to use any piece of S/W that is FOSS community editions,
sometimes it is demanded to manage these products too.
EDB has variations of what they offer, a more specific definition would
be helpful.