-
Type: Improvement
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Logging
-
None
-
Query
-
(copied to CRM)
We should log queries with high ratio of scanned / returned regardless of their execution time to help find inefficient queries.
This is now possible with SERVER-49102 fixed. Each database can be configured with a filter (a query predicate) that controls which operations are logged.
For example, this filter will log queries where the ratio of index keys examined to documents returned is greater than 100:
db.setProfilingLevel(0, {filter: {$expr: {$gt: [ "$keysExamined", {$multiply: ["$nreturned", 100]}, ]}} })
- duplicates
-
SERVER-49102 Accept a filter expression as an alternative to slowMS/sampleRate
- Closed
- related to
-
SERVER-14432 Flexible logging of certain queries
- Closed
- mentioned in
-
Page Loading...