Uploaded image for project: 'Kudu'
  1. Kudu
  2. KUDU-2844

Avoid copying strings from dictionary or plain-encoded blocks

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: cfile, perf
    • Labels:
      None

      Description

      When scanning a plain or dictionary-encoded binary column, we currently loop over each entry and copy the string into the destination RowBlock's arena. In TPCH Q1, the scanner threads use a significant percentage of CPU doing this copying, and it also increases CPU cache footprint which likely decreases performance in downstream operations like predicate evaluation, merging, result serialization, etc.

      Instead of doing this, we could "attach" the dictionary block (with ref-counting) to the RowBlock and refer directly to the dictionary entry from the RowBlock. When the RowBlock eventually is reset, we can drop the reference. This should be safe because we never mutate indirect data in-place.

        Attachments

        1. fg.svg
          318 kB
          Todd Lipcon

          Issue Links

            Activity

              People

              • Assignee:
                tlipcon Todd Lipcon
                Reporter:
                tlipcon Todd Lipcon
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated: