Help Center/
GaussDB(for MySQL)/
User Guide/
DBA Assistant/
SQL Analysis and Tunning/
Viewing Top SQL Statements
Updated on 2024-11-06 GMT+08:00
Viewing Top SQL Statements
Scenarios
After Collect All SQL Statements is enabled, you can gain a comprehensive insight into SQL statements on the SQL Explorer page. Top SQL helps you locate exceptions.
Procedure
- Log in to the management console.
- Click in the upper left corner and select a region and project.
- Click in the upper left corner of the page and choose Databases > GaussDB(for MySQL).
- On the Instances page, click the instance name.
- In the navigation pane, choose DBA Assistant > Historical Diagnosis.
- Choose SQL Explorer > Top SQL.
- Top SQL needs to be purchased separately. To use this function, subscribe to Intelligent O&M first.
- Only the data of the last hour is displayed if Intelligent O&M is not subscribed. The data will be automatically deleted after one hour. If Intelligent O&M is subscribed, you can configure how long that top SQL statements are stored for (at most one day).
- Click Subscribe. In the displayed dialog box, you can learn about Intelligent O&M functions and pricing.
Figure 1 Subscribing to Intelligent O&M
- View the top SQL statements of the DB instance.
Figure 2 Viewing top SQL statements
- View execution durations of the top SQL statements in the last 1 hour, last 3 hours, last 12 hours, or a custom time period (no longer than one day).
- Click a point in time or drag to select a time period to view the SQL statistics of an SQL template.
- Click to export information about all top SQL templates in the list. To use this export function, subscribe to Intelligent O&M.
- Locate an SQL template and click Details to view the total execution times, average rows scanned, average execution duration, and the like.
- Locate an SQL template and click Concurrency Control in the Operation column. For details, see Configuring SQL Statement Concurrency Control.
- Select Comparison by Date and select dates and a time range to view the top SQL statements in the time range on different days.
Figure 3 Comparing top SQL statements
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