Alert all the time - Query Targeting: Scanned Objects / Returned has gone above 1000

Hi Foco!

Thank you for reaching out! Without understanding your system more, it’s hard to say exactly what the problem is. However, in general, I’d recommend starting with the Metrics tab and taking a look at the “Query Targeting” graph to get an understanding of how much work your database is doing versus how much work you’re getting out. I would also recommend taking a look at the Query Profiler and setting the Display dropdown in the top left to “Examined:Returned Ratio”. Here, if you see any slow queries with a high ratio, you can click into the individual operation to learn more.
To do this, click on the dot on the scatter plot and then click on the “View More Details” button.

In the View More Details page, you will see some JSON with more information about the slow operation. In this JSON, I typically like to focus in on a few fields.

  • plansummary will show you whether you are running a collection scan or an index scan. If you see COLLSCAN, that’s a good indication that there may be an index that could benefit your read performance.
  • docsexamined
  • nreturned

Performance Advisor will look at the last 24 hours of your slow logs and make index suggestions. These recommendations may take a bit to show in the Performance Advisor page. However, without understanding your system fully, it’s hard to say whether an index will definitely improve your performance. I’d start with the steps above to see if you have any collection scans and dig in deeper from there.
If you have any further questions, please feel free to reach out to me and/or open a support case so we can provide you further support!

Thanks,
Frank

2 Likes