[SERVER-20486] Problem with in-memory sort Created: 18/Sep/15  Updated: 21/Sep/15  Resolved: 21/Sep/15

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: 2.6.8
Fix Version/s: None

Type: Question Priority: Major - P3
Reporter: Yuvi [X] Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:

 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.



 Comments   
Comment by Stennie Steneker (Inactive) [ 21/Sep/15 ]

Hi Yuri,

The SERVER project is for reporting bugs or feature suggestions for the MongoDB server. For MongoDB-related support discussion please post on the mongodb-user group or Stack Overflow with the mongodb tag, where your question will reach a larger audience. A question like this involving more discussion would likely be best posted on the mongodb-user group.

Regards,
Stephen

Generated at Thu Feb 08 03:54:21 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.