Postgres MCP

by crystaldba
Verified

get_top_queries

Identify and analyze the slowest SQL queries by execution time using data from the 'pg_stat_statements' extension. Specify the number of queries and sort by total or mean execution time to optimize database performance.

Instructions

Reports the slowest SQL queries based on execution time, using data from the 'pg_stat_statements' extension.

Input Schema

NameRequiredDescriptionDefault
limitNoNumber of slow queries to return
sort_byNoSort criteria: 'total' for total execution time or 'mean' for mean execution time per callmean

Input Schema (JSON Schema)

{ "properties": { "limit": { "default": 10, "description": "Number of slow queries to return", "title": "Limit", "type": "integer" }, "sort_by": { "default": "mean", "description": "Sort criteria: 'total' for total execution time or 'mean' for mean execution time per call", "title": "Sort By", "type": "string" } }, "title": "get_top_queriesArguments", "type": "object" }

You must be authenticated.

Other Tools from Postgres MCP

Related Tools

ID: ecl7vgkzit