Guest User

Untitled

a guest
Mar 22nd, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. 1. Enable profile of slow queries, for example queries that take more than 100ms:
  2. ```
  3. db.setProfilingLevel(1, {"slowms" : 50})
  4. ```
  5. 2. Execute suspicious operations/queries
  6. 3. Find top 10 slowest queries:
  7. ```
  8. db.system.profile.find().limit(10).sort( { ts : -1 } ).pretty()
  9. ```
  10. 4. Check execution time (millis) and create indexes for the used fields. For example:
  11. ```
  12. db.RuleResult.createIndex( { _p_user: 1 })
  13. ```
  14. It's also possible to create composed indexes:
  15. ```
  16. db.RuleResult.createIndex( { _p_user: 1, debited: 1 });
  17. ```
Add Comment
Please, Sign In to add comment