Analyze workload
analyze_workloadIdentifies the slowest PostgreSQL queries by mean execution time using pg_stat_statements, and reports when the extension is unavailable so you can diagnose workload performance.
Instructions
Return the slowest queries by mean execution time, via the pg_stat_statements extension. Reports availability=false if the extension is not installed.
Example: analyze_workload(limit=10)
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "analyze_workload"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| database | No | Optional: a database id from list_databases, to target a configured secondary (read-only) database; omit for the primary. Database names that are not configured ids are rejected. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| available | Yes | ||
| slow_queries | Yes |