Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-5080 Create a memory-managed version of the External Sort operator
  3. DRILL-5019

ExternalSortBatch spills all batches to disk even if even one spills

    XMLWordPrintableJSON

    Details

    • Type: Sub-task
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.8.0
    • Fix Version/s: 1.11.0
    • Component/s: None
    • Labels:
      None

      Description

      The ExternalSortBatch (ESB) operator sorts batches while spilling to disk to stay within a defined memory budget.

      Assume the memory budget is 10 GB. Assume that the actual volume of data to be sorted is 10.1 GB. The ESB spills the extra 0.1 GB to disk. (Actually spills more than that, say 5 GB.)

      At the completion of the run, ESB has read all incoming batches. It must now merge those batches. It does so by spilling *all* batches to disk, then doing a disk-based merge.

      This means that exceeding the memory limit by even a small amount is the same as having a very low memory limit: all batches must spill.

      This solution is simple, it works, and has some amount of logic.

      But, it would be better to have a slightly more advanced solution that spills only the smallest possible set of batches to disk, then does a hybrid in-memory, on-disk merge, saving the unnecessary write/read cycle.

        Attachments

          Activity

            People

            • Assignee:
              paul-rogers Paul Rogers
              Reporter:
              paul-rogers Paul Rogers
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: