AtlasOfLivingAustralia / ala-cas-5

ALA CAS 5 implementation
Apache License 2.0
0 stars 11 forks source link

Mongo Atlas warns about ratio of scanned documents to returned #19

Closed sbearcsiro closed 5 years ago

sbearcsiro commented 5 years ago

The full warning is:

Query Targeting: Scanned Objects / Returned has gone above 1000. The ratio of documents scanned to returned exceeded 1000.0 on production shard addr, which typically suggests that un-indexed queries are being run. To help optimize your queries and to identify which query is problematic, we recommend navigating to the Performance Advisor tool within Atlas.”

This alert is generally triggered by one of the following situations: • Clients are performing queries that are not covered by indexes. • Data size (number of documents in queried collection) has grown. • Query is not well targeted (e.g. indexes are on low-cardinality fields or query is malformed).

CAS performs "get" operations by looking up tickets by the "ticketId" field, so ensuring an index exists on this field should resolve this warning. This change is also a candidate for upstreaming.