[SERVER-31357] Using Indexes To Sort Huge Data Created: 03/Oct/17  Updated: 07/Apr/23  Resolved: 03/Oct/17

Status: Closed
Project: Core Server
Component/s: Index Maintenance, Storage
Affects Version/s: 3.2.11
Fix Version/s: None

Type: Question Priority: Critical - P2
Reporter: Pratiksha Aggarwal Assignee: Mark Agarunov
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-3294 Ability to keep data on disk in ~ ind... Closed
Participants:

 Description   

We have a large amount of data and applying pagination on it using below query:
db.collection.find().sort(

{<field>: 1}

).skip(<no. of docs to skip>).limit(<no. of docs to display at once>)

But, I need to create something similar to clustered index i.e which can store sorted documents inorder to avoid in-memory sort at the time of query since the data set is large. Also, this needs to be done to reduce the execution time taken by the query.

According to the search results, MongoDB does not support clustered index. So, is there any workaround for the same?



 Comments   
Comment by Mark Agarunov [ 03/Oct/17 ]

Hello pragupta,

Thank you for the report. Looking over this, you appear to be describing the same behavior as SERVER-3294, which would allow for an implementation of clustered indexes so I've closed this ticket as a duplicate. Please vote for and watch SERVER-18777 for updates on this issue.

Thanks,
Mark

Generated at Thu Feb 08 04:26:46 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.