Skip to main content
Glama

Postgres MCP

by crystaldba

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" }
Install Server

Other Tools from Postgres MCP

Related Tools

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/crystaldba/postgres-mcp'

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