Slow Queries
Scenarios
DDM provides a Slow Queries function that sorts out the same type of slow SQL statements within a specified period of time by SQL template. You can specify a time range, search for all types of slow SQL statements within the time range, and then optimize them.
Viewing Log Details
- Log in to the DDM console.
- On the Instances page, locate the required instance and click its name.
- In the navigation pane, choose Slow Queries.
- On the Slow Queries page, specify a time range and view SQL statements executed within this time range.
- In the upper right corner of the page, you can click
to export slow query logs.
NoteThe size of the exported slow query log file cannot exceed 8 MB. You can select different periods to export slow query log files in batches.
Downloading a Slow Query Log
- Log in to the DDM console.
- On the Instances page, locate the required instance and click its name.
- In the navigation pane, choose Slow Queries.
- On the Download tab, select a node and click Download Slow Query Log.
Figure 1 Downloading slow query logs
- Locate a log whose status is Preparation completed and click Download in the Operation column. The system automatically loads the downloading preparation tasks. The time required depends on the log file size and the network environment.
- When the log is being prepared for download, the file status is Preparing.
- Once the logs are ready for download, the file status changes to Preparation completed.
- Once download preparations fails, the file status changes to Preparation failed.
- Files in the Preparing or Preparation failed status cannot be downloaded.
- Only ZIP files can be downloaded from this page. The time range is calculated from the time you download the files back to the time when the accumulated file size reaches 40 MB.
- The download link is valid for 5 minutes. After the download link expires, a message is displayed indicating that the download link has expired. If you need to redownload the log, click OK.
- Locate a log whose status is Preparation completed and click Download in the Operation column. The system automatically loads the downloading preparation tasks. The time required depends on the log file size and the network environment.
- Scenarios
- Viewing Log Details
- Downloading a Slow Query Log