All Products
Search
Document Center

Analyze slow query logs

Last Updated: Jun 02, 2020

DAS provides the slow query log analysis feature. You can view the trends, execution, and optimization suggestions of slow query logs in the DAS console. This topic uses ApsaraDB RDS for MySQL databases to demonstrate how to use the slow query log analysis feature.

Supported database engines

  • MySQL
  • PostgreSQL
  • Redis
  • MongoDB
  • PolarDB

MySQL, PostgreSQL, Redis, and MongoDB databases can be either Alibaba Cloud databases or user-created databases.

Prerequisites

DAS has accessed the database instance. For more information, see Access other user-created database instances.

View slow query logs of a single database instance

  1. Log on to the DAS console.

  2. In the left-side navigation pane, click Instance Monitoring.

  3. Find the target instance. Choose Performance > Slow Logs in the Actions column.Slow Logs

The Slow Logs page contains the following sections:

  • Slow Log Trend: displays the slow log trend of the target database instance.

  • Slow Log Statistics: displays statistic details of slow query logs within a specified time range. You can also optimize SQL.

    The slow query log optimization feature is only available to ApsaraDB RDS for MySQL databases and user-created MySQL databases.

  • Slow SQL Details: displays details of slow query logs.

View global slow query log trend

If you have multiple database instances, you can view the global slow log trend as well as the slow query log analysis of top 10 instances on the Global Slow Log Trend page.

The global slow query log trend feature is only available to use-created MongoDB, MySQL, and Redis databases, ApsaraDB RDS for MySQL databases, and ApsaraDB for Redis databases.

  1. Log on to the DAS console.

  2. In the left-side navigation pane, choose Request Analysis > Slow Logs to view Slow Log Trend and TOP Instance Statistics.Global Slow Log Trend