You need to enable JavaScript to run this app.
Database Workshop

Database Workshop

Copy page
Download PDF
Log management
Slow log
Copy page
Download PDF
Slow log
This topic describes how to view the analysis results of slow logs and download target slow logs on the Database Workshop (DBW) console.​
Prerequisites​
Precautions​
  • When you access the Slow log analysis tab through Operation observability on the left navigation bar, slow log information about the first instance in the Instance list is viewed by default.​
  • Default displays slow log information from the past 10 minutes, such as the number of slow SQL, CPU usage, and Slow SQL list.​
  • You can view slow log data for up to the past 30 days, with a maximum query time span of 7 days.​
  • When filtering to view slow SQL queries within a certain period, the query end time must be later than the start time.​
  • When you filter by time to view the number of slow SQL queries and CPU usage of primary node or read-only node within a specified time, the slow SQL list pane displays the database, executing user, IP source, average execution time (s), maximum lock wait time (s), average rows returned, and first wait time for eachSQL template within the specified time.​
  • Slow log files downloaded from the system are compressed in .gz (Gzip) format. For macOS users, please extract the downloaded file using the steps below:​
  • Decompress using the built-in gzip or gunzip command-line tools:Open the Terminal and run the gzip or gunzip commands provided by the system to extract the files. The command format is gzip -d your_filename.gz or gunzip your_filename.gz.​
  • To decompress the file using the tar tool: Download and install the tar tool to decompress the file. The command format is tar -xz --force-local -f file_name.gz.​
  • When downloading slow logs, note the following:​
  • Up to 1 million slow log entries can be downloaded in a single request.​
  • Slow log download tasks are retained for 1 day by default. Expired tasks will be automatically deleted.​
  • When you select to download slow log details, you will get the slow SQL that can be executed directly.​
  • You can view and export slow log download files in Export history.​
Query a slow log​
  1. Log on to the DBW console.​
  1. On the top menu bar, select the region.​
  1. On the left navigation bar, select Operation and maintenance management > Observation and diagnosis.​
  1. In the upper-right corner of the Observation and diagnosis page, switch the database Database veDBfor MySQL instance type.​
  • By default, the information about the first instance in the Instance list page is displayed. Click the drop-down icon in the upper-left corner of the page to select the target instance.​
  1. On the Observation and diagnosis page, click Log management.​
  1. On the Slow log tab, filter the time frame as needed. Select the target node (such as the primary node or a read-only node) from the Node ID drop-down list to view the slow log trends, statistics summary, and details of that node, as shown below.​
tip​
  • If you do not select a node ID, the slow log information of all nodes is displayed by default.​
  • In the Node ID dropdown, each node shows the number of slow logs within the selected time frame:​
  • 0 article: Indicates no slow logs during this period, with normal system response, and performance bottlenecks can be ruled out.​
  • Greater than 0 article: Indicates potential performance issues. It is recommended to further analyze the specific slow SQL.​
  • When selecting a time range, the query end time must be later than the start time.​
  • View slow log trends: In the left area of the Slow log details tab, you can view the slow log trends within a certain period. You can also click a specific time point to view the Slow SQL number and CPU usage at that moment.​
  • View slow log statistics: On the right side of the Slow log tab, you can view the Top 1-day slow SQL locations and Top 7-day slow SQL locations for a certain period.​
  • View slow log details: In the Slow SQL List section, filter slow SQL templates as needed and view detailed information of slow SQL within the templates. Specific parameters are shown in the table below.​
tip​
Before viewing slow SQL details on the slow SQL list pane, you need to click the bar graph of a certain point in time in the slow log development trend graph.​
  • ​
    Enable/Disable shard compatibility
    Filter slow SQL
    View slow SQL list
    View slow SQL details
    ​
    • After enabling Shard compatible, in the sharding scenario, SQL templates with the same logical database and table names will be aggregated together, and the aggregated SQL template will be displayed.​
    • After disabling Shard compatible, all SQL templates are displayed in the sharding scenario.​
    tip​
    In general, the number of SQL templates after shard compatibility is enabled is less than the number of SQL templates after shard compatibility is disabled.​
    ​
Download a slow log​
tip​
  • Up to 1 million slow log entries can be downloaded in a single request.​
  • Slow log download tasks are retained for 1 day by default. Expired tasks will be automatically deleted.​
  • View and export the download file of slow log in the export history.​
  • Slow log files downloaded from the system are compressed in .gz (Gzip) format. For macOS users, please extract the downloaded file using the steps below:​
  • Decompress using the built-in gzip or gunzip command-line tools:Open the Terminal and run the gzip or gunzip commands provided by the system to extract the files. The command format is gzip -d your_filename.gz or gunzip your_filename.gz.​
  • To decompress the file using the tar tool: Download and install the tar tool to decompress the file. The command format is tar -xz --force-local -f file_name.gz.​
  1. Log on to the DBW console.​
  1. On the top menu bar, select the region.​
  1. On the left navigation bar, select Operation and maintenance management > Observation and diagnosis.​
  1. In the upper-right corner of the Observation and diagnosis page, switch the database Database veDBfor MySQL instance type.​
  • By default, the information about the first instance in the Instance list page is displayed. Click the drop-down icon in the upper-left corner of the page to select the target instance.​
  1. On the Observation and diagnosis page, click Log management.​
  • In the slow SQL statistics area, select the time period you want to view.​
  1. In the Slow log tab, in the Slow SQL list area, click Advanced filtering to filter the SQL list as needed, and then click the download icon.​
  • Select the range of slow logs to download as needed. Currently, Export slow log details and Export current page are supported. The specific configurations are as follows:​
  • ​
    Export slow log details
    Export current page
    ​
    1. The exported slow log details include slow SQL that can be executed directly.​
    1. Click Export slow log details. In the Export slow log details dialog box, configure the following parameters.​
    • ​
      Parameter​
      Description​
      File format​
      Currently, only the CSV slow log format for downloads is supported. No selection is required.​
      Export range​
      Select the range of slow logs to download as needed. Currently, Custom, Past 2 hours, Past 12 hours, and Past 24 hours are supported.​
      Custom time period​
      Select the time range for log export.​
      tip​
      This parameter can be set when Export range is set to Custom.​
      ​
    1. Click OK.​
    1. On the Slow log details tab, click the download icon, and then click Export history.​
    1. In the Export history dialog box, select the target task whose Status is Generated, and click Download file in the Actions column.​
    ​
  • ​
Last updated: 2026.09.01 16:57:39