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

Hash Join Enhancement: Avoid copying probe side values

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 1.11.0
    • Fix Version/s: None
    • Labels:
      None

      Description

      When the Hash Join Operator (inner, or left outer) performs the "probe and project" task, it copies each probe side values to be projected. Example:

          public void projectProbeRecord(int probeIndex, int outIndex)
              throws SchemaChangeException
          {
              {
                  vv15 .copyFromSafe((probeIndex), (outIndex), vv12);
              }
              {
                  vv21 .copyFromSafe((probeIndex), (outIndex), vv18);
              }
          }
      

      In the case where there are no duplicate-key entries in the build side, and no spilling took place, then each of the outer values is projected exactly once (for left outer), or at most once (for inner join).

      In such (common) cases, we could avoid the above copy, and just transfer the value vectors as is (or add a Selection Vector 2 for the inner join, to eliminate the unmatched entries).

      This can be a significant performance enhancement, as copying each set of values is much more expensive than transposing vectors (e.g., perform the copy 64K times, plus allocation of the vectors, and possible resizing for variable sized types).

        Attachments

          Activity

            People

            • Assignee:
              ben-zvi Boaz Ben-Zvi
              Reporter:
              ben-zvi Boaz Ben-Zvi
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: