explain_query_working
Explains in plain English how a SQL query runs, covering logical clause order and the physical plan to diagnose slow performance before execution.
Instructions
Explain in plain English HOW a query behaves — two layers: (1) the logical gather order (FROM -> WHERE -> GROUP BY -> HAVING -> SELECT -> ORDER BY -> LIMIT), why 'LIMIT 10' can still be slow; and (2) the actual physical plan the engine chose for THIS query, bottom-up. Call when a user asks why a query is slow or how it runs. Teaching tool. Pass target= in a multi-DB setup.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | ||
| target | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |