PostgreSQL Performance Runbook by agentskillexchange/skills
npx skills add https://github.com/agentskillexchange/skills --skill 'PostgreSQL Performance Runbook'通过 pg_stat_statements、pg_stat_activity 和 pg_locks 系统视图对 PostgreSQL 执行诊断查询。识别慢查询、锁争用、通过 pgstattuple 检测表膨胀,并生成包含缓冲区统计信息的 EXPLAIN ANALYZE 报告。
PostgreSQL 性能运行手册技能通过查询 PostgreSQL 系统目录视图和扩展来自动化数据库性能诊断。它通过 libpq 连接并运行结构化的诊断序列。
该技能查询 pg_stat_statements 以获取按总执行时间和平均执行时间排序的顶级查询,查询 pg_stat_activity 以获取活动/事务中空闲的会话,查询与 pg_stat_activity 关联的 pg_locks 以进行锁争用分析,并查询 pg_stat_user_tables 以找出需要索引的频繁进行顺序扫描的表。
高级诊断包括:使用 pgstattuple 扩展查询进行表和索引膨胀估计,使用 pg_stat_bgwriter 进行检查点频率分析,使用 pg_stat_wal 进行 WAL 生成速率分析,以及使用 pg_stat_replication 进行副本延迟测量。
对于识别出的慢查询,该技能会生成 EXPLAIN (ANALYZE, BUFFERS, FORMAT TEXT) 输出,并解释嵌套循环与哈希连接的选择、位图扫描的有效性以及排序内存溢出情况。它推荐具体的 CREATE INDEX 语句、work_mem 调整和 vacuum 参数调优。
运行手册输出按严重级别(严重/警告/信息)进行结构化组织,并包含具体的配置参数建议以及 pg_reload_conf() 安全注意事项。
npx skills add agentskillexchange/skills --skill postgresql-performance-runbook
npx skills add agentskillexchange/skills --skill postgresql-performance-runbook -a claude-code
npx skills add agentskillexchange/skills --skill postgresql-performance-runbook -a cursor
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
npx skills add agentskillexchange/skills --skill postgresql-performance-runbook -a codex
clawhub install postgresql-performance-runbook
每周安装次数
–
代码仓库
GitHub 星标数
1
首次出现时间
–
安全审计
Executes diagnostic queries against PostgreSQL using pg_stat_statements, pg_stat_activity, and pg_locks system views. Identifies slow queries, lock contention, bloated tables via pgstattuple, and generates EXPLAIN ANALYZE reports with buffer statistics.
The PostgreSQL Performance Runbook skill automates database performance diagnostics by querying PostgreSQL system catalog views and extensions. It connects via libpq and runs a structured diagnostic sequence.
The skill queries pg_stat_statements for top queries by total_exec_time and mean_exec_time, pg_stat_activity for active/idle-in-transaction sessions, pg_locks joined with pg_stat_activity for lock contention analysis, and pg_stat_user_tables for sequential scan heavy tables needing indexes.
Advanced diagnostics include: pgstattuple extension queries for table and index bloat estimation, pg_stat_bgwriter for checkpoint frequency analysis, pg_stat_wal for WAL generation rate, and pg_stat_replication for replica lag measurement.
For identified slow queries, the skill generates EXPLAIN (ANALYZE, BUFFERS, FORMAT TEXT) output with interpretation of nested loop vs hash join choices, bitmap scan effectiveness, and sort memory spillage. It recommends specific CREATE INDEX statements, work_mem adjustments, and vacuum parameter tuning.
The runbook output is structured with severity levels (critical/warning/info) and includes specific configuration parameter recommendations with pg_reload_conf() safety notes.
npx skills add agentskillexchange/skills --skill postgresql-performance-runbook
npx skills add agentskillexchange/skills --skill postgresql-performance-runbook -a claude-code
npx skills add agentskillexchange/skills --skill postgresql-performance-runbook -a cursor
npx skills add agentskillexchange/skills --skill postgresql-performance-runbook -a codex
clawhub install postgresql-performance-runbook
Weekly Installs
–
Repository
GitHub Stars
1
First Seen
–
Security Audits
Azure 升级评估与自动化工具 - 轻松迁移 Functions 计划、托管层级和 SKU
79,900 周安装