Skip to main content
Glama

PostgreSQL-Performance-Tuner-Mcp

analyze_query

Analyze SQL query execution plans and performance metrics using EXPLAIN ANALYZE to identify optimization opportunities, timing breakdowns, and buffer usage statistics.

Instructions

Analyze a SQL query's execution plan and performance characteristics.

Uses EXPLAIN ANALYZE to execute the query and capture detailed timing information. Provides analysis of:

  • Execution plan with actual vs estimated rows

  • Timing breakdown by operation

  • Buffer usage and I/O statistics

  • Potential performance issues and recommendations

WARNING: This actually executes the query! For SELECT queries this is safe, but be careful with INSERT/UPDATE/DELETE - use analyze_only=false for those.

Input Schema

NameRequiredDescriptionDefault
queryYesThe SQL query to analyze
analyzeNoWhether to actually execute the query (EXPLAIN ANALYZE vs EXPLAIN)
buffersNoInclude buffer usage statistics
verboseNoInclude verbose output with additional details
formatNoOutput format for the execution planjson
settingsNoInclude information about configuration parameters

Input Schema (JSON Schema)

{ "properties": { "analyze": { "default": true, "description": "Whether to actually execute the query (EXPLAIN ANALYZE vs EXPLAIN)", "type": "boolean" }, "buffers": { "default": true, "description": "Include buffer usage statistics", "type": "boolean" }, "format": { "default": "json", "description": "Output format for the execution plan", "enum": [ "text", "json", "yaml", "xml" ], "type": "string" }, "query": { "description": "The SQL query to analyze", "type": "string" }, "settings": { "default": false, "description": "Include information about configuration parameters", "type": "boolean" }, "verbose": { "default": false, "description": "Include verbose output with additional details", "type": "boolean" } }, "required": [ "query" ], "type": "object" }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/isdaniel/pgtuner-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server