-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
None
-
Affects Version/s: 2.6.4, 2.7.6
-
Component/s: Querying
-
None
-
Query
-
ALL
Regression since 2.4; affects current v2.6 and master.
The following metrics from serverStatus().metrics no longer get updated properly:
- operation.idhack
- queryExecutor.scanned
- queryExecutor.scannedObjects
Reproduce with:
// Test "operation.idhack" when query uses idhack. db.foo.drop(); db.foo.insert({_id: 0}); oldMetrics = db.serverStatus().metrics; db.foo.find({_id: 0}).itcount(); newMetrics = db.serverStatus().metrics; assert.eq(newMetrics.operation.idhack, oldMetrics.operation.idhack + 1); // Test "queryExecutor.scanned" when query scans index entries. db.foo.drop(); db.foo.ensureIndex({a: 1}); db.foo.insert({a: 1}); db.foo.insert({a: 2, b: 0}); db.foo.insert({a: 2, b: 1}); db.foo.insert({a: 2, b: 1}); oldMetrics = db.serverStatus().metrics; db.foo.find({a: 2, b: 1}).hint({a: 1}).itcount(); newMetrics = db.serverStatus().metrics; assert.eq(newMetrics.queryExecutor.scanned, oldMetrics.queryExecutor.scanned + 3); // Test "queryExecutor.scannedObjects" when query fetches documents. db.foo.drop(); db.foo.ensureIndex({a: 1, b: 1}); db.foo.insert({a: 1, b: 1, c: 1}); db.foo.insert({a: 1, b: 1, c: 1}); db.foo.insert({a: 1, b: 2, c: 1}); oldMetrics = db.serverStatus().metrics; db.foo.find({b: 1, c: 1}).hint({a: 1, b: 1}).itcount(); newMetrics = db.serverStatus().metrics; assert.eq(newMetrics.queryExecutor.scannedObjects, oldMetrics.queryExecutor.scannedObjects + 3);
- is related to
-
SERVER-14964 nscanned not written to the logs at logLevel 1 unless slowms exceeded or profiling enabled
- Closed
-
SERVER-13197 Tighten index bounds and allow compound index to be chosen when predicate on leading field is not provided
- Backlog
-
SERVER-17862 Unify stats reporting for log/profiler across CRUD operations
- Closed
- related to
-
SERVER-15238 Add jstests for serverStatus().metrics
- Backlog