Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-8968

Best practices for using mongodb cursor

    • Type: Icon: Question Question
    • Resolution: Done
    • Priority: Icon: Critical - P2 Critical - P2
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:
      Mongodb with nodejs driver

      When I do a find, we get a new cursor from mongo.

      I never close these cursors, i leave it to mongo to handle everything.
      But if I 'force close' the cursor after every find (since i never re-use it and i have thousands of finds per second), will that improve performance or it just doesn't matter ?

      Also is it worth implementing logic to re-use a cursor (because technically i do 'very similar queries' over an over again) ? Or getting a new cursor is extremely fast and not expensive at all ?

            Assignee:
            Unassigned Unassigned
            Reporter:
            kurteknikk Kurt Agius
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: