get_execution_plan
Analyzes a SELECT statement to show which indexes Firebird will use, without executing the query. Helps detect accidental full-table scans before running.
Instructions
Return the query execution plan for a SELECT — shows which indexes Firebird will use. The query is prepared but never executed, so it is safe on large tables. Use before run_query to detect accidental full-table scans. Returns a plan string such as 'PLAN (TABLE NATURAL)' or 'PLAN (TABLE INDEX (IDX_NAME))'.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| database | Yes | Database key from list_databases. | |
| sql | Yes | A SELECT statement to analyse. No trailing semicolon. DML not supported. |