Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1. Enable profile of slow queries, for example queries that take more than 100ms:
- ```
- db.setProfilingLevel(1, {"slowms" : 50})
- ```
- 2. Execute suspicious operations/queries
- 3. Find top 10 slowest queries:
- ```
- db.system.profile.find().limit(10).sort( { ts : -1 } ).pretty()
- ```
- 4. Check execution time (millis) and create indexes for the used fields. For example:
- ```
- db.RuleResult.createIndex( { _p_user: 1 })
- ```
- It's also possible to create composed indexes:
- ```
- db.RuleResult.createIndex( { _p_user: 1, debited: 1 });
- ```
Add Comment
Please, Sign In to add comment