Help Center/
Data Admin Service/
User Guide/
MySQL/
Intelligent O&M (Old Version)/
SQL/
SQL Diagnosis
Updated on 2024-11-28 GMT+08:00
SQL Diagnosis
This function enables you to diagnose SQL statements and obtain optimization suggestions.
Precautions
- This function is available only to MySQL InnoDB.
- Only SELECT, INSERT, UPDATE, and DELETE statements can be diagnosed. An INSERT statement must contain a SELECT clause.
- Currently, SQL statements of databases information_schema, test, and mysql cannot be queried.
- SQL statements that contain views cannot be diagnosed.
- SQL Diagnosis obtains table structures and data distribution information (non-original). The obtained data is only for logic diagnosis, but not stored on the DAS server.
- Obtaining table structures and data distribution information may cause additional load to your instance, but has little impact on its performance.
- SQL diagnosis history is stored on the DAS server only. If you delete SQL diagnosis history on the console, it will be also deleted from the DAS server.
- SQL formatting improves readability of SQL statements. Formatting SQL statements enables statements to be displayed in line break mode, but does not change their logic and semantics.
- SQL formatting takes effect for all the SQL statements in the SQL window. You cannot format only one selected statement.
Procedure
- Log in to the DAS console.
- Click in the upper left corner and select a region and project.
- Click in the upper left corner, and under Databases, click Data Admin Service.
- In the navigation pane, choose Intelligent O&M > Instance List.
Alternatively, on the Overview page, click Go to Intelligent O&M.
- In the upper right corner of the Instance List page, search for instances by engine type, instance name, or instance IP.
Figure 1 Searching for instances
- Locate the box containing your target instance and click Details.
- In the upper right corner of the page, click Go to Old Edition.
- Choose SQL > SQL Diagnosis. On the displayed dialog box, perform the following operations:
- On the SQL Diagnosis tab page, select the database where you want to diagnose a SQL statement, enter a SQL statement, and click Diagnose. The diagnosis result page is displayed.
- Select a database where you want to execute a SQL statement, enter a SQL statement, and click Execute. The system executes the statement and displays a result set.
- Select the database where you want to format SQL statements, enter SQL statements, and click Format. The system formats all the SQL statements.
- Select the database where you want to view the SQL execution plan, enter SQL statements, and click View Execution Plan. The system executes all the SQL statements in sequence.
Parent topic: SQL
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
The system is busy. Please try again later.
For any further questions, feel free to contact us through the chatbot.
Chatbot