Database Autonomy Service (DAS) provides the SQL diagnostics feature. This feature allows DAS to perform diagnostics on SQL statements, provide index optimization suggestions, and then create indexes for your database instance based on these suggestions. You can enable automatic SQL diagnostics and index creation in the DAS console.
Prerequisites
- A database instance is connected to DAS. The database instance is an ApsaraDB RDS for MySQL instance of the High-availability Edition or the Enterprise Edition or a PolarDB for MySQL cluster of the Cluster Edition or the Archive Database Edition.
- The autonomy service is enabled for the database instance. For more information, see Autonomy center.
- SQL Explorer is enabled for the database instance. For more information, see SQL Explorer.
Note
- After slow SQL queries are optimized, the overall performance of the database instance may degrade. To ensure that the automatic SQL optimization feature optimizes only abnormal SQL statements, we recommend that you enable SQL Explorer.
- If you do not enable SQL Explorer, you can use only SQL diagnostics but not automatic index creation.
Background information
Procedure
Related API operations
GetSqlOptimizeAdviceBest practices
What to do next
- On the Autonomy center page in the DAS console, you can view optimization events that occurred during a specified time period.
- On the right side of Slow SQL Statement Diagnostics (Diagnostics and Optimization), click Details. Then, on the Root Cause Analysis and Suggestions tab, you can view information about Problematic SQL Statements, SQL Statement Optimization, Index Recommendation, and Statement Optimization.