Analyze workload
analyze_workloadIdentify slowest database queries by mean execution time using pg_stat_statements to optimize 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)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| database | No | Optional: target a configured secondary (read-only) database by name; omit for the primary. Call list_databases to see the configured ids. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| available | Yes | ||
| slow_queries | Yes |