postgresql 监控 - 洞察力
2022/8/12 2:23:19
本文主要是介绍postgresql 监控 - 洞察力,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
1. 监控请求数据 The total number of connected clients and their states (active, idle in transaction, waiting)
SELECT COUNT ( * ) FILTER ( WHERE STATE IS NOT NULL ) AS total, COUNT ( * ) FILTER ( WHERE STATE = 'idle' ) AS idle, COUNT ( * ) FILTER ( WHERE STATE IN ( 'idle in transaction', 'idle in transaction (aborted)' ) ) AS idle_in_xact, COUNT ( * ) FILTER ( WHERE STATE = 'active' ) AS active, COUNT ( * ) FILTER ( WHERE wait_event_type = 'Lock' ) AS waiting, COUNT ( * ) FILTER ( WHERE STATE IN ( 'fastpath function call', 'disabled' ) ) AS OTHERS FROM pg_stat_activity WHERE backend_type = 'client backend';
越 接近情报,越增加财富
听大佬的直播,第一手资料
这篇关于postgresql 监控 - 洞察力的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-01-05快速清空 PostgreSQL 数据库中的所有表格,让你的数据库重新焕然一新!
- 2024-01-04在PostgreSQL中创建角色:判断角色是否存在并创建
- 2023-05-16PostgreSQL一站式插件推荐 -- pg_enterprise_views
- 2022-11-22PostgreSQL 实时位置跟踪
- 2022-11-22如何将PostgreSQL插件移植到openGauss
- 2022-11-11PostgreSQL:修改数据库用户的密码
- 2022-11-06Windows 环境搭建 PostgreSQL 物理复制高可用架构数据库服务
- 2022-10-27Windows 环境搭建 PostgreSQL 逻辑复制高可用架构数据库服务
- 2022-10-11PostgreSql安装(Windows10版本)
- 2022-09-13PostgreSQL-Network Address类型操作和函数