在 Postgres 中查找特定查询的 CPU 利用率的工具

1 postgresql

我只想知道是否有任何免费工具可以识别 PostgreSQL 中特定查询的 CPU 利用率。

a_h*_*ame 6

您可以使用操作系统的 CPU 监视器(例如top在 Linux 或 Windows 中的 ProcessExplorer)。

与数据库的每次连接都会在服务器上创建一个新进程。与连接相关的进程 id 报告在pid系统视图的列中pg_stat_activity

使用该进程 ID,您可以监视该进程的 CPU 使用率,这实质上是您的查询的 CPU 使用率(当然,它正在运行时)

手册中的更多详细信息:http : //www.postgresql.org/docs/current/static/monitoring.html 和 Postgres Wiki:https : //wiki.postgresql.org/wiki/Performance_Analysis_Tools