| From: | Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com> |
|---|---|
| To: | KK CHN <kkchn(dot)in(at)gmail(dot)com> |
| Cc: | pgsql-general <pgsql-general(at)postgresql(dot)org> |
| Subject: | Re: Resource Usage same In spite of fronting my DB server with Pgbouncer ? |
| Date: | 2026-01-23 23:11:19 |
| Message-ID: | 86a7a676-a6c0-4b66-a729-adfb80030331@aklaver.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
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.
| From | Date | Subject | |
|---|---|---|---|
| Next Message | mark bradley | 2026-01-25 22:08:58 | Re: pgAdmin connects 100s of times |
| Previous Message | KK CHN | 2026-01-23 19:47:19 | Re: Resource Usage same In spite of fronting my DB server with Pgbouncer ? |