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

Problem with in-memory sort

    XMLWordPrintableJSON

Details

    • Icon: Question Question
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • None
    • 2.6.8
    • Querying
    • None

    Description

      I have 40050 document within a collection. The document has about 48 attributes and with size being 935 (used Object.bsonsize(..) to identify the size).
      When I try to run,
      db.collection.find(

      {someSearhCriteria}

      ).sort(

      {attribute1:1}

      ).limit(50).skip(40000)
      it results in
      error:

      { "$err" : "Runner error: Overflow sort stage buffered data usage of 33555101 bytes exceeds internal limit of 33554432 bytes", "code" : 17144 }

      at src/mongo/shell/query.js:131

      I understand that creating an index on "attribute1" would fix this problem. In my application however, we enable sorting on all the 48 attributes the document has. Also, the number of documents satisfying the criteria could run into few hundred thousands. I want to understand if you still suggest creating index on all the 48 attributes? Or is there a better approach?

      Would appreciate your help.

      Attachments

        Activity

          People

            Unassigned Unassigned
            YuviMeiyappan Yuvi [X]
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: