Performance Monitoring Operations Guide
MCP-PostgreSQL-Ops provides a variety of features dedicated to performance monitoring to help users locate and resolve performance issues:
- get_pg_stat_statements_top_queries: Analyzing slow-executing queries (slow queries)
- get_pg_stat_monitor_recent_queries: Real-time monitoring of recently executed queries
- get_index_usage_stats: Analyze index usage frequency and efficiency
- get_active_connections: View the current number of active connections and session details
Typical Application Scenarios
When the application is slow to respond, you can quickly locate the problem SQL by asking "Analyze the most resource-intensive SQL query" or "Show the most recent slow query" For index efficiency issues, ask "Check which indexes are underutilized". For index efficiency issues, ask "Check which indexes are underutilized".
pre-conditions
These features require the pg_stat_statements extension to be enabled for the database, and the pg_stat_monitor extension can be added for more comprehensive monitoring if necessary.
This answer comes from the articleMCP-PostgreSQL-Ops: Tools for PostgreSQL Database Operations and MonitoringThe