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

Improve memory limit assignment for Sort operators

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: In Progress
    • Major
    • Resolution: Unresolved
    • 1.4.0
    • None
    • None
    • None

    Description

      Currently, the max_query_memory_per_node is divided among all the Sort operators in the query plan, regardless of whether the Sort operators are executing at the same time. Since Sort is a blocking operator, the number of concurrent Sorts running is limited. Thus, the Sort on both sides of a MergeJoin could be concurrently executing but a Sort that occurs above the MergeJoin cannot start until the MergeJoin produces a row which is only when both the child Sorts have produced a row.

      Due to the conservative estimate, we have seen queries such as TPC-H Q8 with forced MergeJoin run out-of-memory even with high max_query_memory_per_node. This query plan has 15 Sort operators and with max_width = 23, max_query_memory_per_node = 20GB, each Sort gets only 63MB (20GB/(23*15)). We should improve the algorithm for computing the memory limit.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              amansinha100 Aman Sinha
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated: