-
Type: New Feature
-
Resolution: Unresolved
-
Priority: Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: Querying
-
None
-
Query Optimization
I've indexed the queried fields, which makes the count works very fast when nobody is updating documents in the collection, but whenever i start more workers, or whenever there is some load, the output is very slow:
2016-03-09T00:58:22.805+0200 I COMMAND [conn2451] command squeue.in_auth command: count { count: "in_auth", query: { payload.group: "group1" } } planSummary: COUNT_SCAN { payload.group: 1.0, payload.customer: 1.0 } keyUpdates:0 writeConflicts:0 numYields:8125 reslen:122 locks:{ Global: { acquireCount: { r: 16252 } }, Database: { acquireCount: { r: 8126 } }, Collection: { acquireCount: { r: 8126 } } } protocol:op_query 511ms
Is there any way to make an approximative, but FAST count which ignores the updates? It doesn't matter if it displays a few hundred more or less items in a collection with 10 million docs.
I'm on a sharded cluster btw (8 rs).
- is related to
-
SERVER-39191 Performance regression for counts post-sharding
- Closed