AI SQL Optimizer [v26.3]
The AI SQL Optimizer is an AI-powered performance analysis tool built into the SQL Query Dataview editor. It analyzes the current SQL query against the configured data source schema and execution plan, identifies performance issues, and produces an optimized version of the query with a plain-English explanation of each finding.
The AI SQL Optimizer is available on the Bizview Platform only. Only system administrators with access to Dataviews can use this feature.
Note: The AI SQL Optimizer is available from Bizview version 26.3.
Prerequisites
- Must have BV30 system administrator role.
- Configure the data source for the SQL Query Dataview.
Accessing the AI SQL Optimizer
The AI SQL Optimizer is available in the SQL Query Dataview editor only. It is not available in other Dataview types.
Navigate to System > Data Views and open a SQL Query Dataview. The editor opens on the Query tab by default.
Note: The AI Optimize button appears for SQL Query Type Dataviews. When the SQL editor is empty, the button is disabled.
Using the AI SQL Optimizer
The AI SQL Optimizer analyzes the current SQL query against the data source schema and execution plan, identifies performance issues, and presents an optimized version of the query with a plain-English explanation of each finding. Review the findings and accept or discard the suggestion directly from the panel.
-
Click AI Optimize in the toolbar.
The AI SQL Optimizer panel opens within the editor area and displays a real-time progress checklist as the agent reads the current SQL, retrieves the data source schema, and analyzes the query execution plan.
Note: Analysis may take 30–50 seconds depending on the query.
- When analysis is complete, the panel displays one or more findings. Each finding describes the performance issue identified, the category and severity, and the recommended optimization with an explanation of the expected improvement.
-
Scroll down to review the full results. Below the findings, the panel displays:
- Schema Recommendations — index changes recommended based on the execution plan analysis.
- Notes — additional context from the agent about the recommendations, including any constraints or limitations that apply.
- Your SQL | Suggested — a side-by-side view showing the original SQL on the left and the optimized SQL on the right. Lines removed from the original are highlighted in red. Lines added in the suggestion are highlighted in green.
Note: When the agent determines that no SQL rewrite is needed, the panel displays a message stating that no safe SQL-only optimization was found and that the original SQL is preserved unchanged. Schema recommendations may still apply.
Example:
- At the bottom of the panel, select one of the following actions:
-
Click Accept to apply the optimized SQL to the editor.
The Save button in the toolbar becomes active, indicating that the Dataview has unsaved changes.
- Click Discard to close the panel with no changes to the editor content.
-
-
Review the optimized query in the Your SQL | Suggested view, then select one of the following from the Dataview editor toolbar:
- Click Save to commit the optimized query to the Dataview.
- Click Cancel to revert to the original query without saving.
Caution: Once you accept and save the Dataview, the original query cannot be recovered from within the editor. Review the optimized query carefully in the Your SQL | Suggested view before accepting, or before clicking Save in the Dataview editor toolbar.
- After either action, the AI Optimize button becomes active again. The optimizer can be re-run on the current or updated query at any time.
Viewing Optimization History in Lineos
Bizview saves each AI SQL Optimizer session to the Lineos chat history. The full session — including the agent’s findings, schema recommendations, and the suggested SQL — is available for reference at any time.
To view a previous session, open the Lineos panel and select the relevant conversation from the chat history list.
Sessions are listed under the title SQL query optimization.
Note: Lineos does not retain chat history in Incognito mode sessions.