Skip to main content
Run any Skill in Manus
with one click

pg-top-sql-analyze

Stars1
Forks0
UpdatedJuly 13, 2026 at 08:05

基于 pg_stat_statements 对 PostgreSQL 实例做两阶段快照采集与差值分析,找出总耗时、单次最慢、高频调用、IO消耗、WAL生成量、返回行数异常等多维度 TOP SQL,并给出索引/改写/批量化等具体优化建议与健康评分。触发场景包括:'帮我分析一下这个库的慢SQL'、'找TOP SQL'、'pg_stat_statements 分析'、'数据库性能诊断'、'哪些SQL最耗资源'、'帮我看看这个实例的负载画像'、'SQL优化建议'、'缓存命中率低怎么排查'、用户给出 PostgreSQL 连接信息(host/port/user/password/dbname)并希望做性能巡检或SQL调优时。即使用户只说'帮我看看这个库最近跑得怎么样'或'这些SQL要怎么优化'并提供了连接信息,也应使用本技能。

Installation

Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.

File Explorer
7 files
SKILL.md
readonly