Query Tuning
Analyze SQL from the SQL Editor in AI Chat and review rewrite and index suggestions.
Select a target
Query Tuning can start whenever the SQL Editor contains non-empty SQL.
- The entry action does not pre-limit SQL type or statement count.
- Selected text takes priority.
- Without a selection, the statement containing the cursor is used.
- SQL comments are removed before attaching it to AI Chat.
- For reliable estimated-plan analysis, use one read-only SELECT statement.
How to use
Start from the SQL Editor context menu.
1
Select SQL
Select the target SQL or place the cursor in the statement.
2
Choose AI: Query Tuning
Choose the Query Tuning action from the context menu.
3
Check the attachment
AI Chat receives a locked SQL target and default tuning instructions.
4
Send and review
Review suggestions informed by the necessary metadata and estimated plan.

DB context and estimated plan
The target Editor's DB context is added to the request automatically and locked.
- The locked target context cannot be removed from the request.
- Other Connections and Schemas can be added as supporting contexts.
- Estimated plans are supported for MySQL, MariaDB, SQL Server, PostgreSQL, Oracle, and H2.
- SQLite does not provide an estimated plan.
Review results
Suggestions appear as inline SQL cards and do not modify the original SQL Editor.
- Review rewritten SQL and index DDL separately, and open an editable regular SQL Editor copy when needed.
- The original Editor SQL is not changed automatically.
- A rewritten SELECT with an execution route runs automatically after the response.
- Index DDL can run when schema-change auto-apply is on for the target Connection.