I just want to know is there any free tool to identify CPU utilization for a particular query in PostgreSQL.
Postgresql – Tool to find CPU utilization for a particular query in Postgres
postgresql
Related Question
- Postgresql – How to monitor slow query in AWS RDS Postgres
- PostgreSQL Performance – How to Find Resource Intensive SQL Operations
- Postgresql – Sudden High CPU Usage On RDS Postgres
- Postgresql – How to find the system impact of a query in postgres
- Postgresql – ny option to kill the particular process automatically if it is consuming a particular value of cpu
Best Answer
You can use the CPU monitor of your operating system (e.g.
top
in Linux or ProcessExplorer in Windows).Each connection to the database will create a new process on the server. The process id related to the connection is reported in the column
pid
of the system viewpg_stat_activity
.With that process ID you can monitor the CPU usage of that process which is essentially the CPU usage of your query (while it's running of course)
More details in the manual: http://www.postgresql.org/docs/current/static/monitoring.html and the Postgres Wiki: https://wiki.postgresql.org/wiki/Performance_Analysis_Tools