preflight_query
Estimate SQL query cost and risk on the real schema before execution. Get risk tier, rows scanned vs returned, scan strategy, and overhead flags without running the query.
Instructions
Before running ANY SQL query you (the agent) just wrote, check how costly it will be on the real schema — WITHOUT executing it. Returns a risk tier (cheap/moderate/expensive/dangerous), rows scanned vs returned, scan strategy, and overhead flags (missing index, SELECT *, no LIMIT, N+1 / nested-loop blowup). EXPLAIN only — never runs the query. In a multi-DB setup pass target= (see list_targets). For similarity search use preflight_vector_search; with no DB use preflight_schema_only.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | ||
| target | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |