0

I'm using MongoDB Atlas and noticed a warning in the Performance Advisor and monitoring dashboard:

"Query Targeting: Scanned Objects / Returned" has gone above 1000

From my understanding, this means my queries are scanning too many documents relative to the number of results returned, which could impact performance.

I'd like to understand:

  1. What causes this metric to spike?

  2. How can I identify which query or queries are triggering this?

  3. What are the best practices to optimize such queries?

  4. Should I create new indexes or modify existing ones? If so, how can I determine the right fields?

Any guidance, especially around debugging this within Atlas and applying the right indexes, would be much appreciated.

Thanks!

1
  • This is probably going to get closed as it is not focused enough and does not provide enough detail to assist. The documentation on this specific topic should be a great place to start though: mongodb.com/docs/atlas/reference/alert-resolutions/… Commented Apr 9 at 15:41

1 Answer 1

-1

To figure out which query is causing it, check the Performance Advisor or the Profiler tab in MongoDB Atlas — both will show you the problematic queries. To fix it, look at the fields you're using in filters and sorting, and create indexes based on that.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.