Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-10885

[Rust][DataFusion] Optimize join build vs probe based on statistics on row number

    XMLWordPrintableJSON

Details

    Description

      Based on number of rows in a datasource we can optimize which table should be part of the build phase and which part of the probe phase in a hash join. We should make the (approximately) smallest datasource. This can have a large effect on performance if one of the two tables is much bigger than the other, as we can skip building a large lookup table.

      Recently we are adding statistics to data sources in DataFusion, so this seems something we can add relatively easily. We can approximate the number of rows based on underlying statistics in datasources, but it should at least work for simple cases first.
      When swapping the order a left join has to be changed to a right join and vice versa, inner joins remain the same. Probably it is easier to start with inner joins and then add left / right joins.

      Maybe we should also rename some internals to make clear that e.g. the left part is part of the build and the right part of the probe.

      Attachments

        Issue Links

          Activity

            People

              Dandandan Daniël Heres
              Dandandan Daniël Heres
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 7h 20m
                  7h 20m