| |
Set the slow log diagnosis range | DBW displays slow log diagnostic results from the previous day by default. You can filter slow log diagnosis data for a specific date as needed. |
View the overview of diagnostic results | After setting the slow log diagnosis scope, you can view the diagnostic results of slow logs for the specified date, including the Total number of slow SQL diagnoss, Number of SQL statements recommended for optimization, Number of SQL recommended for index creation , Number of SQL with rewrite suggestions, and Number of SQL with no optimization suggestions. tip - Total number of slow SQL diagnoses: Only the Top 200 slow log records in the instance are diagnosed.
- Total number of slow SQL diagnoses = Number of SQL statements recommended for optimization + Number of SQL with no optimization suggestions.
- Number of SQL statements recommended for optimization = Number of SQL recommended for index creation + Number of SQL with rewrite suggestions.
|
View the index creation suggestion list | - View slow log information by template, including SQL template, Optimization recommendation level, Database, Table name, IP source, Execution user, Execution times, Average rows scanned, Average rows returned, Recommended index SQL text, Average execution time(s), Estimated average execution time after optimization(s), Estimated performance improvement times after optimization, and Total time consumption ratio.
- View slow log information by index, including Recommended index SQL text, SQL template, Optimization recommendation level, Database, Table name, IP source, Execution user, Execution times, Average rows scanned, Average rows returned, Average execution time(s), and Total time consumption ratio.
|
View the list of SQL rewrite suggestions | Includes SQL template, Optimization recommendation level, Database, Table name, IP source, Execution user, Execution times, Average rows scanned, Average rows returned, SQL rewrite suggestions, Average execution time(s), and Total time consumption ratio. |
View the list of SQL without optimization suggestions | Includes SQL template, Optimization recommendation level, Database, Table name, IP source, Execution user, Execution times, Average rows scanned, Average rows returned, Average execution time(s), Total time consumption ratio, and Suggestions. |
| In the SQL list, click the name of the SQL template to open the SQL details panel. In the SQL details panel, you can view the parameter information of different tabs: - Execution details: On the Execution details tab, you can preform the following operations:
- View the information of each SQL statement, including the SQL statement's Start time, SQL text, Database, Execution user, IP source, Execution time(s), Lock wait time(s), Rows scanned, and Rows returned.
- View SQL optimization suggestions:
- Click SQL optimization in the Actions column of the target SQL text. In the Allow authorization dialog box, click Authorize.
- The index optimization suggestion function needs to sample and analyze the content of the database and table. Therefore, when you view the index optimization suggestion of SQL for the first time, you need to authorize DBW to read the database and table. If it is already enabled, you do not need to perform this operation again.
- It takes about 10 to 20 seconds to view SQL index optimization suggestions.
- In the SQL optimization suggestions dialog box, view SQL optimization suggestions including database name and SQL statement, execution plan, and optimization suggestions, with optimization suggestions including index optimization and SQL rewrite.
- Execution statistics: On the Execution statistics tab, you can view all SQL text information that meets the filtering criteria in the SQL template.
- Total time consumption ratio: The proportion of the total time consumption of the current SQL template to the total time consumption of all SQL lists within a certain period of time.
- Total lock wait time ratio: The ratio of the total lock wait time of the current SQL template to the total lock wait time of all SQL lists within a certain period of time.
- Percentage of total rows scanned: The ratio of the total number of scanned rows in the current SQL template to the total time consumption of all SQL lists within a certain period of time.
- Percentage of total rows returned: The ratio of the total number of returned rows in the current SQL template to the total number of returned rows in all SQL lists.
- SQL execution times: view the trend of slow SQL within the filtered time period.
- Execution profiling: Displays the execution status of SQL statements in each stage to help you analyze and locate problems.
- SQL analysis: on the SQL analysis tab, you can view the following information.
- SQL text: includes all SQL text information within the SQL template; click the copy icon to copy the SQL text.
- Execution plan: Includes select_type information interpretation, type information interpretation, and extra information interpretation.
- Optimization suggestions: Includes optimization suggestions for SQL statements. You can refer to these suggestions to optimize your SQL statements.
|