Analytics and optimization with AI assistant
Note
This feature is in the Preview stage.
WebSQL features an integrated AI assistant you can use to:
- Generate SQL queries from natural language descriptions.
- Fix SQL queries from your query editor.
- Optimize SQL queries from your query editor.
- Perform a database overview.
- Conduct database index analysis.
Warning
The AI assistant can make mistakes. Always check its suggestions for validity.
Generating database queries
The AI assistant can generate SQL queries based on natural language descriptions, for example:
Find all users who have not placed any orders in the last 30 days.
Create a test table named
testand populate it with 10 entries.
Queries follow the syntax and structure of the database you select.
The AI assistant does not execute SQL queries. Execute them using one of these methods:
- Click Execute query below the generated SQL query. This will automatically execute the query in the query editor.
- Copy the query from the AI assistant's response and execute it manually.
Fixing and optimizing database queries
The AI assistant can fix and optimize SQL queries from your query editor based on the syntax and structure of the database you select. You can also fix and optimize other SQL queries to the selected database by forwarding them directly into the chat.
Fixing
-
Open Yandex WebSQL
. -
Connect to the database of your choice in the
Connections section. -
In the left-hand panel, select AI assistant. The AI assistant window will open.
-
Type
Fix errors in this queryand click .This will create a new chat where the AI assistant will help you correct the SQL query from the query editor. If no query is present in the editor, the assistant will prompt you to enter the SQL query you want fixed.
Optimizing
-
Open Yandex WebSQL
. -
Connect to the database of your choice in the
Connections section. -
In the left-hand panel, select AI assistant. The AI assistant window will open.
-
In the AI assistant window, click the suggested message:
Optimize SQL query.This will create a new chat where the AI assistant will help you optimize the SQL query from the query editor. If there is no query in the editor, the assistant will prompt you to enter the SQL query you want optimized.
Database analysis
The AI assistant helps with database overview and index analysis.
Database overview
-
Open Yandex WebSQL
. -
Connect to the database of your choice in the
Connections section. -
In the left-hand panel, select AI assistant. The AI assistant window will open.
-
In the AI assistant window, click the suggested message:
Review current database.This will create a new chat where the AI assistant will overview the selected database.
Database index analysis
-
Open Yandex WebSQL
. -
Connect to the database of your choice in the
Connections section. -
In the left-hand panel, select AI assistant. The AI assistant window will open.
-
In the AI assistant window, click the suggested message:
Analyze database indexes.This will create a new chat where the AI assistant will analyze the indexes of the selected database and give some optimization recommendations.
Chat management
The AI assistant can help you create chats. Chats are not associated with any connection or database; however, the AI assistant's responses are guided by the context of the selected database.
Each chat session gets saved, so you can always return to it if you need to.
If you no longer need a chat, you can delete it.
Creating a new chat
- Open Yandex WebSQL
. - Connect to the database of your choice in the
Connections section. - In the left-hand panel, select AI assistant. The AI assistant window will open.
- To start a new chat with the AI assistant, type a message and click
.
Viewing chat history
-
Open Yandex WebSQL
. -
Connect to the database of your choice in the
Connections section. -
In the left-hand panel, select AI assistant. The AI assistant window will open.
-
In the top-left corner of the AI assistant window, click
. You will be directed to the chat management page.The page offers the history of your chats with the AI assistant.
Deleting a chat
- Open Yandex WebSQL
. - Connect to the database of your choice in the
Connections section. - In the left-hand panel, select AI assistant. The AI assistant window will open.
- In the top-left corner of the AI assistant window, click
. You will be directed to the chat management page. - Click
next to the chat.