2010YOUY01 opened a new pull request, #27401: URL: https://github.com/apache/datafusion/pull/27401
> [!IMPORTANT] > > **Fork CI setup:** For pull requests from a fork to `main`, enable workflows in your fork's **Actions** tab before you push. > See the [fork CI setup guide](https://datafusion.apache.org/contributor-guide/#pull-requests-from-forks). ## Which issue does this PR close? <!-- We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123. --> Step 2 of - https://github.com/apache/datafusion/issues/27398 This PR builds on top of https://github.com/apache/datafusion/pull/27399, commit 2 is for this PR. Needs rebase after 1st PR is merged. ## Rationale for this change <!-- Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed. Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes. Please explain the problem you are trying to solve in terms of the user-visible behavior, rather than the implementation. For example, "The code in `foo.rs` doesn't handle nulls" is a symptom of the implementation. "COUNT(DISTINCT) returns wrong results when the column contains nulls" is the user-visible problem. --> See https://github.com/apache/datafusion/issues/27398 for details `hj` benchmark result: ``` ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓ ┃ Query ┃ main ┃ vec-ht ┃ Change ┃ ┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩ │ QQuery 1_density=1_prob_hit=1_25*1.5M │ 1.07 ms │ 1.12 ms │ no change │ │ QQuery 2_density=0.026_prob_hit=1_25*1.5M │ 3.32 ms │ 4.47 ms │ 1.35x slower │ │ QQuery 3_density=1_prob_hit=1_100K*60M │ 55.13 ms │ 55.42 ms │ no change │ │ QQuery 4_density=1_prob_hit=0.1_100K*60M │ 158.77 ms │ 146.74 ms │ +1.08x faster │ │ QQuery 5_density=0.75_prob_hit=1_100K*60M │ 584.66 ms │ 171.51 ms │ +3.41x faster │ │ QQuery 6_density=0.75_prob_hit=0.1_100K*60M │ 219.85 ms │ 206.06 ms │ +1.07x faster │ │ QQuery 7_density=0.5_prob_hit=1_100K*60M │ 598.32 ms │ 164.35 ms │ +3.64x faster │ │ QQuery 8_density=0.5_prob_hit=0.1_100K*60M │ 208.76 ms │ 197.83 ms │ +1.06x faster │ │ QQuery 9_density=0.2_prob_hit=1_100K*60M │ 582.67 ms │ 168.23 ms │ +3.46x faster │ │ QQuery 10_density=0.2_prob_hit=0.1_100K*60M │ 209.91 ms │ 202.32 ms │ no change │ │ QQuery 11_density=0.1_prob_hit=1_100K*60M │ 584.03 ms │ 171.17 ms │ +3.41x faster │ │ QQuery 12_density=0.1_prob_hit=0.1_100K*60M │ 214.30 ms │ 212.03 ms │ no change │ │ QQuery 13_density=0.01_prob_hit=1_100K*60M │ 608.84 ms │ 185.13 ms │ +3.29x faster │ │ QQuery 14_density=0.01_prob_hit=0.1_100K*60M │ 218.62 ms │ 219.30 ms │ no change │ │ QQuery 15_density=0.2_prob_hit=0.1_100K_(20%_dups)*60M │ 197.45 ms │ 166.08 ms │ +1.19x faster │ │ QQuery 16_density=1_prob_hit=1_25*1.5M_RightSemi │ 1.38 ms │ 1.42 ms │ no change │ │ QQuery 17_density=1_prob_hit=1_100K*60M_RightSemi │ 57.59 ms │ 57.41 ms │ no change │ │ QQuery 18_density=1_prob_hit=0.1_100K*60M_RightSemi │ 71.99 ms │ 70.57 ms │ no change │ │ QQuery 19_density=1_prob_hit=1_25*1.5M_RightAnti │ 1.11 ms │ 1.08 ms │ no change │ │ QQuery 20_density=1_prob_hit=1_100K*60M_RightAnti │ 52.92 ms │ 52.65 ms │ no change │ │ QQuery 21_density=1_prob_hit=0.1_100K*60M_RightAnti │ 77.23 ms │ 78.34 ms │ no change │ │ QQuery 22_density=1_prob_hit=0.01_100K_(fanout_100)*60M_RightSemi │ 78.84 ms │ 80.95 ms │ no change │ │ QQuery 23_density=1_prob_hit=1_32K_(fanout~78)*2.3M_long_keys_count │ 89.26 ms │ 26.34 ms │ +3.39x faster │ │ QQuery 24_density=1_prob_hit=1_3K_(single_hot_bucket)*20K_long_keys_count │ 281.53 ms │ 35.50 ms │ +7.93x faster │ │ QQuery 25_density=1_prob_hit=1_20K_(fanout~78_multi_key)*240K_multi_key_count │ 108.82 ms │ 24.79 ms │ +4.39x faster │ │ QQuery 26_density=1_prob_hit=0.027_270K_dense_keys*15M │ 41.95 ms │ 42.67 ms │ no change │ │ QQuery 27_density=0.027_prob_hit=0.027_270K_sparse_keys*15M │ 48.62 ms │ 44.72 ms │ +1.09x faster │ └───────────────────────────────────────────────────────────────────────────────┴───────────┴───────────┴───────────────┘ ┏━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━┓ ┃ Benchmark Summary ┃ ┃ ┡━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━┩ │ Total Time (main) │ 5356.92ms │ │ Total Time (vec-ht) │ 2788.19ms │ │ Average Time (main) │ 198.40ms │ │ Average Time (vec-ht) │ 103.27ms │ │ Queries Faster │ 13 │ │ Queries Slower │ 1 │ │ Queries with No Change │ 13 │ │ Queries with Failure │ 0 │ └────────────────────────┴───────────┘ ``` ## What changes are included in this PR? <!-- There is no need to duplicate the description in the issue here, but it is sometimes worth providing a summary of the individual changes in this PR. --> To read the diff, there are only 3 key points (all explained in #27398) - The idea of hash table physical redesign - Two key abstraction layers: `BatchedJoinProcessor` and `JoinIndexMap` Then read in order: 1. entry point at `regular_join.rs`, `into_stream()` 2. Next see the key struct `BatchedJoinProcessor` 3. This PR changes `BatchedJoinProcessor` inner probing implementation with `JoinIndexMap` 4. `JoinIndexMap` implements the new contiguous match storage HT layout ## What is the testing strategy for this PR? <!-- We typically require tests for all PRs in order to: 1. Prevent the code from being accidentally broken by subsequent changes 5. Serve as another way to document the expected behavior of the code Briefly describe how this PR is tested, and point to the specific tests you added. For example: 'This new feature is covered by the `sqllogictest` cases added in `foo.slt`'. If this PR does not add tests, explain why. For example, if the change is already covered by existing tests, please mention it. You should also check the `codecov` bot reply on this PR to confirm the changed code is exercised. --> ## Are there any user-facing changes? <!-- If there are user-facing changes then we may require documentation to be updated before approving the PR. If there are any breaking changes to public APIs, please add the `api change` label. --> -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
