Skip to content

Fix join squashing with sparse columns#81886

Merged
nickitat merged 9 commits intomasterfrom
fix_join_squashing
Jul 2, 2025
Merged

Fix join squashing with sparse columns#81886
nickitat merged 9 commits intomasterfrom
fix_join_squashing

Conversation

@nickitat
Copy link
Copy Markdown
Member

@nickitat nickitat commented Jun 15, 2025

Changelog category (leave one):

  • Performance Improvement

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):

Add new setting min_joined_block_size_rows (analogous to min_joined_block_size_bytes; defaults to 65409) to control the minimum block size (in rows) for JOIN input and output blocks (if the join algorithm supports it). Small blocks will be squashed.


The motivation when we introduced squashing around join transforms for parallel hash was the following. Previously, we physically split blocks to distribute them among parallel hash join "shards". All input blocks automatically became max_threads times smaller after splitting. Since not all rows usually have a match during joining, output blocks were even smaller. On top of that, multiple joins might be chained on each other. Because of that, we saw significant slowdowns with parallel hash on some TPC-H queries. At that time, I decided to use only the byte threshold to configure squashing. The problem with Sparse columns is that they can have a compression factor close to the number of rows. For such cases, it makes sense also to have the number-of-rows threshold configured, because since our goal is to avoid passing too small blocks along the pipeline, we definitely shouldn't worry about blocks that are bigger than DEFAULT_BLOCK_SIZE.

@clickhouse-gh
Copy link
Copy Markdown
Contributor

clickhouse-gh bot commented Jun 15, 2025

Workflow [PR], commit [557071f]

@clickhouse-gh clickhouse-gh bot added the pr-performance Pull request with some performance improvements label Jun 15, 2025
@clickhouse-gh
Copy link
Copy Markdown
Contributor

clickhouse-gh bot commented Jun 16, 2025

Workflow [PR], commit [0ade907]

Summary:

job_name test_name status info comment
Stress test (amd_tsan) failure
Sanitizer assert (in stderr.log) FAIL
Fatal message in clickhouse-server.log (see fatal_messages.txt) FAIL
Found signal in gdb.log FAIL
Performance Comparison (amd_release, master_head, 3/3) failure
Check Results failure

@novikd novikd self-assigned this Jun 17, 2025
@nickitat nickitat marked this pull request as ready for review June 17, 2025 21:08
Copy link
Copy Markdown
Member

@novikd novikd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but I see grace_hash_join became slower in the performance tests. Is it related?

@nickitat
Copy link
Copy Markdown
Member Author

nickitat commented Jul 1, 2025

LGTM, but I see grace_hash_join became slower in the performance tests. Is it related?

It looks so. I haven't found any specific problem I could address, so just decided to ignore it.

@nickitat nickitat enabled auto-merge July 2, 2025 17:52
@nickitat nickitat added this pull request to the merge queue Jul 2, 2025
Merged via the queue into master with commit a7842aa Jul 2, 2025
230 of 241 checks passed
@nickitat nickitat deleted the fix_join_squashing branch July 2, 2025 19:54
@robot-ch-test-poll4 robot-ch-test-poll4 added the pr-synced-to-cloud The PR is synced to the cloud repo label Jul 2, 2025
baibaichen pushed a commit to Kyligence/gluten that referenced this pull request Jul 3, 2025
baibaichen pushed a commit to Kyligence/gluten that referenced this pull request Jul 4, 2025
baibaichen pushed a commit to Kyligence/gluten that referenced this pull request Jul 5, 2025
baibaichen pushed a commit to apache/gluten that referenced this pull request Jul 6, 2025
* [GLUTEN-1632][CH]Daily Update Clickhouse Version (20250705)

* Fix benchmark build

* Fix Benchmark build due to ClickHouse/ClickHouse#79417

* Revert "Fix Build due to ClickHouse/ClickHouse#80931"

This reverts commit 02d12f6.

* Fix Build due to ClickHouse/ClickHouse#81886

* Fix Link issue due to ClickHouse/ClickHouse#83121

* Fix Build due to ClickHouse/ClickHouse#82604

* Fix Build due to ClickHouse/ClickHouse#82945

* Fix Build due to ClickHouse/ClickHouse#83214

---------

Co-authored-by: kyligence-git <[email protected]>
Co-authored-by: Chang chen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-performance Pull request with some performance improvements pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants