You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This means that MongoDB must select one of the indexes to perform a partial search against, and then perform a linear search over the partial search results to complete the query.
With some datasets, I have seen MongoDB perform a linear search over ~300 documents for each beaconFQDN upsert.
When the FQDN analysis performs an upsert against the
beaconFQDN
collection, it uses the following selector:https://github.com/activecm/rita/blob/e6c740f6ef1e2b88950eb63b1f3c6538720d0de3/pkg/beaconfqdn/repository.go#L82-L86
However, this selector is not fully covered by a MongoDB index:
https://github.com/activecm/rita/blob/e6c740f6ef1e2b88950eb63b1f3c6538720d0de3/pkg/beaconfqdn/mongodb.go#L50-L55
This means that MongoDB must select one of the indexes to perform a partial search against, and then perform a linear search over the partial search results to complete the query.
With some datasets, I have seen MongoDB perform a linear search over ~300 documents for each
beaconFQDN
upsert.A similar problem exists in the
beaconProxy
code.Selector:
https://github.com/activecm/rita/blob/e6c740f6ef1e2b88950eb63b1f3c6538720d0de3/pkg/beaconproxy/repository.go#L123-L129
Indexes:
https://github.com/activecm/rita/blob/e6c740f6ef1e2b88950eb63b1f3c6538720d0de3/pkg/beaconproxy/mongodb.go#L48-L54
Unique indexes should be added to cover these upsert selectors such that no linear searches should be performed.
The text was updated successfully, but these errors were encountered: