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

batchSize is a hard limit for an in memory sort

    XMLWordPrintableJSON

Details

    • Question
    • Status: Closed
    • Major - P3
    • Resolution: Duplicate
    • None
    • None
    • None
    • None

    Description

      Batch size is a hard limit if the selected plan for a query does an in memory sort. (The first and only batch will have size <= the specified batchSize.) This behavior isn't explicitly described in the docs, so I wanted to check if it's desired.

      > c.save( {} )
      > c.save( {} )
      > c.save( {} )
      > c.find().batchSize( 2 )
      { "_id" : ObjectId("4f6bc6c16f6654844e41b644") }
      { "_id" : ObjectId("4f6bc6c16f6654844e41b645") }
      { "_id" : ObjectId("4f6bc6c56f6654844e41b646") }
      > c.find().sort( {a:1} ).batchSize( 2 )
      { "_id" : ObjectId("4f6bc6c16f6654844e41b644") }
      { "_id" : ObjectId("4f6bc6c16f6654844e41b645") }

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              aaron Aaron Staple
              Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: