Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-33961

order-by optimization via max-heap popping instead of final sort

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Done
    • Major
    • Morpheus
    • 6.5.0
    • query
    • None

    Description

      A performance suggestion, based on unproven, rough reading of the code...

      When doing an ORDER BY ... OFFSET x LIMIT y, a max-heap that can grow to size x+y is maintained. At the very end, a final sort.Sort() is performed on the collected items.

      If that's the correct understanding, this might be optimized where instead of a final sorting of the items (which can have up to x+y number of entries), the max-heap can instead be Pop()'ed by y number of times to retrieve the sorted results.

      Attachments

        Issue Links

          For Gerrit Dashboard: MB-33961
          # Subject Branch Project Status CR V

          Activity

            People

              Donald.haggart Donald Haggart
              steve Steve Yen
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty