All Products
Search
Document Center

ApsaraDB for MongoDB:Slow query logs

Last Updated:Mar 28, 2026

Slow queries degrade database performance and can be difficult to identify without dedicated tooling. ApsaraDB for MongoDB provides slow query log analysis through CloudDBA, giving you four views of your query performance data so you can pinpoint bottlenecks, understand their root causes, and optimize indexes.

Prerequisites

Before you begin, make sure you have:

  • A replica set instance or a sharded cluster instance

Limits

LimitDetails
Log entry size32 KB maximum. Content exceeding this limit is truncated.
Query windowPrevious month only
Time range per queryMaximum 24 hours. The end time must be later than the start time.

View slow query logs

  1. Go to the ApsaraDB for MongoDB Replica Set Instances page or the ApsaraDB for MongoDB Sharded Cluster Instances page. At the top of the page, select a resource group and a region, then click the ID of the target instance.

  2. In the left navigation pane, click CloudDBA > Slow Query Log Analysis.

  3. Set a time range. The page shows four sections:

    SectionWhat it showsWhen to use it
    Slow Query Log TrendsA trend chart of slow queries over time. Click a point in time to view statistics and details at that moment.Identify when performance degraded
    Event DistributionSlow query events in the selected time range. Click an event to view its details.Find which events caused spikes
    Slow Query Log StatisticsAggregated statistics by SQL template. Click Details in the Actions column to view a sample in the Slow Log Sample dialog box.Compare query patterns and prioritize optimization
    Slow Query Log DetailsIndividual slow query log entries.Inspect specific queries for root cause analysis
  4. (Optional) Take additional actions as needed:

    • If your instance is a sharded cluster, select a node from the Node ID drop-down list to filter slow queries by node.

    • If an SQL statement is truncated in the view, hover over it to see the full content.

    • Click download icon to download the slow query logs to your computer.

    • Click OpenAPI icon to load the current parameters into the OpenAPI console for API debugging.

Next steps

After you identify the root cause, take action to improve query performance: