find_blocking_queries
Identify blocking database sessions in a hierarchical tree to diagnose performance issues and select queries to kill.
Instructions
Show currently-blocking sessions in a friendly tree (blocker → blocked) using pg_stat_activity ⨝ pg_blocking_pids(). Replaces the gnarly join an AI agent struggles to write. Returns each session's pid, user, database, application name, state, current query, time in state, and wait_event. Use to diagnose slowdowns and pick a candidate for kill_query.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| include_idle | No | ||
| limit | No | ||
| server | No | ||
| database | No | ||
| schema | No |