Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-3165

Sorting a Mongo table should leverage Mongo Indexes

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.0.0
    • Future
    • Storage - MongoDB
    • None

    Description

      When doing a query using Mongo, sorting takes place entirely in Drill.

      Getting the first 1000 rows from a 1000000 rows table, sorted by a field which has an index takes a long time (about 45 seconds in our test environment).

      Sample drill query:
      Select c.name from mongo.foo.json_customers c order by c.name limit 1000

      Doing the same in mongo client takes less than a second.

      Sample mongo query: db.json_customers.find().sort(

      {"name":1}

      ).limit(1000)

      Sorting by a field should leverage the existing mongo indexes if they exist.

      Attachments

        Activity

          People

            Unassigned Unassigned
            leandrodg Leandro DG
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated: