Docs Menu
Docs Home
MongoDB Cloud Manager

Analyze Slow Queries

On this page

  • Performance Advisor
  • Query Insights
  • Profiler
  • Best Practices for Query Performance

Cloud Manager provides several tools to help analyze slow queries executed on your clusters. See the following sections for descriptions of each tool. To optimize your query performance, review the best practices for query performance.

The Performance Advisor monitors slow queries and suggests new indexes to improve query performance.

You can use the Performance Advisor to review the following information:

Monitor collection-level query latency with Query Insights. You can view query latency metrics and statistics for certain hosts and operation types. Manage pinned namespaces and choose up to five namespaces to show in the corresponding query latency charts.

The Profiler displays slow-running operations and their key performance statistics. You can explore a sample of historical queries for up to the last 24 hours without additional performance overhead. Before you enable the Profiler, see Considerations.

To optimize query performance, review the following best practices:

  • Create queries that your current indexes support to reduce the time needed to search for your results.

  • Avoid creating documents with large array fields that require a lot of processing to search and index.

  • Optimize your indexes and remove unused or inefficent indexes. Too many indexes can negatively affect write performance.

  • Consider the suggested indexes from the Performance Advisor with the highest Impact scores and lowest Average Query Targeting scores.

  • Create the indexes that the Performance Advisor suggests when they align with your Indexing Strategies.

  • The Performance Advisor can't suggest indexes for MongoDB databases configured to use the ctime timestamp format. As a workaround, set the timestamp format for such databases to either iso8601-utc or iso8601-local.

  • Perform rolling index builds to reduce the performance impact of building indexes on replica sets and sharded clusters.

  • Drop unused, redundant, and hidden indexes to improve write performance and free storage space.

← Monitor Your Deployments