Query Slow Logs

Last updated: 2020-07-07 12:18:00

Slow logs are often used as the basis for optimizing business operations in MongoDB. For more information on slow logs, please see Database Profiler. You can query slow logs in the TencentDB for MongoDB Console.

  • The system logs operations with an execution time of more than 100 ms.
  • The slow logs are retained for 7 days. You are recommended to limit the query time range within 1 day.
  • Only the first 10,000 slow logs can be queried. If the query is slow, you can narrow down the query time range.

Log in to the TencentDB for MongoDB Console and click an instance name to enter the instance management page. Select Database Management > Slow Log Query.

Query Methods

The system provides two query methods as described below:

  • Query statistics: aggregate query analysis conducted based on the command (operation) type.
  • Query details: details of the slow logs within a specified time period.

Query Results

The statistics query result contains four fields:

  • Query Method: it is consistent with the method selected by the user, which is "Query statistics" in this case.
  • Sample Statement: the statement output with the command type as the aggregation dimension. You mainly need to refer to the command type when troubleshooting problems.
  • Average Execution Time (ms): the average execution time (in ms) of operations aggregated in the dimension of the command type.
  • Total: the total occurrences of operations aggregated in the dimension of the command type.

A details query result contains three fields:

  • Query Method: it is consistent with the method selected by the user, which is "Query statistics" in this case.
  • Time Consumed: the execution time of the business command (in ms).
  • Log Details: the details of the business command.

Was this page helpful?

Was this page helpful?

  • Not at all
  • Not very helpful
  • Somewhat helpful
  • Very helpful
  • Extremely helpful
Send Feedback
Help