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

Consolidate the two code paths for running find commands in the mongo shell

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major - P3
    • Resolution: Unresolved
    • None
    • None
    • Querying, Shell
    • Query Execution
    • 0

    Description

      The shell uses DBCommandCursor to iterate results returned from the "cursor-generating commands" (find, aggregate, listIndexes, listCollections). The implementation is primarily in Javascript:

      https://github.com/mongodb/mongo/blob/bd76599a88e8062c634eeb6918bb30f868bc6042/src/mongo/shell/query.js#L650-L804

      Rewriting this functionality in C++ would most likely make this code run faster. It would also ensure that the shell does not consume excessive memory, since memory required to buffer each batch of results could be reclaimed after the batch is exhausted. Currently, the Javascript engine's garbage collector may not run frequently enough to reclaim memory in a timely manner, especially for queries returning many megabytes worth of results.

      Attachments

        Issue Links

          Activity

            People

              backlog-query-execution Backlog - Query Execution
              david.storch@mongodb.com David Storch
              Votes:
              0 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

                Created:
                Updated: