Check Query Performance and Explain Plan for Query Optimization

<< Click to Display Table of Contents >>

Navigation:  Tools > AI Assistant >

Check Query Performance and Explain Plan for Query Optimization

You can use the AI Assistant for query performance testing and plan analysis. When you have a query open in the SQL Editor, or (Materialized) View Editors, you can use the quick message menu in the AI Chat to retrieve that query and have the AI Assistant analyze it.

 

Here's an example. There's a View Editor opened, SQLite demo database "sakila". We instruct the AI Chat to optimize the current query using the quick messages menu at the bottom right.

 

 

The AI Assistant will retrieve the current query and check the current performance.

 

 

Mind you, it says "rows fetched", but it won't be able to view your actual data.

 

Next, it shows the query execution plan and its analysis, follow by suggestions.

 

 

Depending on the outcome, it could be the AI Assistant suggests creating a new index. Or perhaps rewrite the query.

 

If you like, you can have the AI Assistant try out different versions of the query and check performance of one version to another, all by itself.

 

Mind you, the AI Assistant can not modify meta data by itself, for safety reasons. You can have it suggest an index and the CREATE-statement for it, but you have to execute it using one of the buttons in the top right corner of the SQL statement.

 

Database Workbench provides the tools, the AI does the job, saving you the time.