Using Indexes To Sort Huge Data

XMLWordPrintableJSON

    • Type: Question
    • Resolution: Duplicate
    • Priority: Critical - P2
    • None
    • Affects Version/s: 3.2.11
    • Component/s: Index Maintenance, Storage
    • None
    • None
    • 0
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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?

              Assignee:
              Mark Agarunov (Inactive)
              Reporter:
              Pratiksha Aggarwal
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: