Updated on 2023-11-21 GMT+08:00

Slow Query Logs

Scenarios

GeminiDB Mongo API allows you to view slow query logs of databases. The unit of the execution time is ms. You can identify the SQL statements that take a long time to execute and tune them based on slow query logs.

Showing Original Logs

  • After Show Original Log is enabled, it cannot be disabled.
  • After Show Original Log is enabled, original logs are displayed. The original slow query logs are displayed for your query and retained for 30 days.
  • If the instance to which the slow query log belongs is deleted, related logs are also deleted after Show Original Log is enabled.
  1. Log in to the management console.
  2. In the service list, choose Databases > GeminiDB Mongo API.
  3. On the Instances page, locate the instance whose original logs you want to view and click its name.
  4. In the navigation pane on the left, choose Slow Query Logs.
  5. On the Slow Query Logs page, click .
  6. In the displayed dialog box, click Yes to enable the function of slowing original logs.

Viewing and Exporting Log Details

  1. Log in to the management console.
  2. In the service list, choose Databases > GeminiDB Mongo API.
  3. On the Instances page, locate the instance whose slow query logs you want to view and click its name.
  4. In the navigation pane on the left, choose Slow Query Logs.
  5. On the Slow Query Logs page, set search criteria and click Search to view log information.

    • Select All nodes and view slow query logs of all nodes. Alternatively, select a specific node to view its slow query logs.
    • View slow query logs of a specific node in different time ranges.
    • View slow query logs of the following types of SQL statements:
      • All SQL statement types
      • SELECT
      • QUERY
      • UPDATE
      • REMOVE
      • GETMORE
      • COMMAND
      • KILLCURSORS

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

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