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:
What causes this metric to spike?
How can I identify which query or queries are triggering this?
What are the best practices to optimize such queries?
Should I create new indexes or modify existing ones? If so, how canI determine the right fields?
Any guidance, especially around debugging this within Atlas and applying the right indexes, would be much appreciated.
Thanks!