Updated on 2026-01-23 GMT+08:00

Managing Slow Query Logs

Scenarios

Slow query logs record statements that take longer than slowlog-threshold (default: 300,000 microseconds). For details, see Modifying Parameters of GeminiDB Redis Instances. You can view and configure database-level slow query logs of GeminiDB Redis instances. Slow query logs allow you to identify and optimize statements that run longer than expected.

Billing

You will be billed for enabling this function. For details, see LTS Price Calculator.

Reporting Slow Query Logs to LTS

After log groups and log streams are configured, slow query logs are stored in LTS. You can view the reported slow query logs in LTS.

  1. Log in to the GeminiDB console.
  2. In the navigation pane, choose Log Reporting.
  3. Select an instance and click next to Report Slow Logs to LTS.
  4. Select an LTS log group and log stream and click OK.

    You will be billed for enabling this function. For details, see LTS pricing details.

    Figure 1 Reporting slow query logs to LTS

Viewing and Exporting Log Details

  1. Log in to the GeminiDB console.
  2. On the Instances page, click the target instance.
  3. In the navigation pane on the left, choose Slow Query Logs.
  4. On the Slow Query Logs page, set search criteria and click Search to view log information.

    Figure 2 Viewing slow query logs
    • Some instances of earlier kernel minor version need to be upgraded by following Upgrading the Kernel Minor Version to enable metrics Database Where a Big Key Is Located, Request Size, Number of Request Parameters, Returned Packet Size, and Number of Returned Values.
    • SQL queries that take longer than 300 milliseconds to execute are considered as slow queries.
    • Select All nodes and view slow query logs of all nodes. Alternatively, select a specific node to view its slow query logs.
      Figure 3 Querying nodes
    • Choose to view slow query logs of all types of SQL statements or a specific SQL statement.
      • SET
      • GET
      • DEL
      • INCR
      • INCRBY
      • INCRBYFLOAT
      • DECR
      • DECRBY
      • GETSET
      • APPEND
      • MGET

      ······

      You can query slow query logs of all Redis statement types.

    • View slow query logs of a specific node in different time ranges.

  5. On the Log Details page, click in the upper right corner of the log list to export log details.

    • You can view the CSV file exported to your local PC.
    • Up to 2,000 logs can be exported at a time.
      Figure 4 Exporting slow query logs

Related APIs

API

Description

Querying Slow Query Logs of a GeminiDB Redis Instance

Queries slow query logs of a GeminiDB Redis instance by keyword.