Skip to content

Minor perf improvement in partial_merge_join - #96922

Merged
alexey-milovidov merged 1 commit into
ClickHouse:masterfrom
4ertus2:pertial_merge_join
Feb 15, 2026
Merged

alexey-milovidov merged 1 commit into
ClickHouse:masterfrom
4ertus2:pertial_merge_join

Conversation

@4ertus2

@4ertus2 4ertus2 commented Feb 14, 2026 •

Copy link
Copy Markdown
Contributor

Changelog category (leave one):

  • Not for changelog (changelog entry is not required)

Minor perf improvement in partial_merge_join.

Improvement is visible in in_memory variant with non-composite join keys. I've testeted it over some TPC-H queries with these options

SET join_algorithm = 'partial_merge';
SET max_rows_in_join = 100000000000000;
SET max_bytes_in_join = 100000000000000;

Version info

  • Merged into: 26.2.1.759

@alexey-milovidov alexey-milovidov added the can be tested Allows running workflows for external contributors label Feb 15, 2026
@alexey-milovidov

Copy link
Copy Markdown
Member

@4ertus2, and what was the result?

@clickhouse-gh

clickhouse-gh Bot commented Feb 15, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [bb5f485]

Summary: ✅

@clickhouse-gh clickhouse-gh Bot added the pr-not-for-changelog This PR should not be mentioned in the changelog label Feb 15, 2026

@alexey-milovidov alexey-milovidov left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't see any notable changes, but overall it looks reasonable.

@alexey-milovidov alexey-milovidov self-assigned this Feb 15, 2026
@4ertus2

4ertus2 commented Feb 15, 2026 •

Copy link
Copy Markdown
Contributor Author

@4ertus2, and what was the result?

CPU E5-2697av4, 64GB mem
TPC-H SF 10

./bin/clickhouse-benchmark --cumulative -q "SELECT l_orderkey, sum(l_extendedprice * (1 - l_discount)) AS revenue, o_orderdate, o_shippriority FROM customer, orders, lineitem WHERE (c_mktsegment = 'BUILDING') AND (c_custkey = o_custkey) AND (l_orderkey = o_orderkey) AND (o_orderdate < toDate('1995-03-15')) AND (l_shipdate > toDate('1995-03-15')) GROUP BY l_orderkey, o_orderdate, o_shippriority ORDER BY revenue DESC, o_orderdate ASC LIMIT 10 SETTINGS join_algorithm = 'partial_merge', max_rows_in_join = 100000000000000, max_bytes_in_join = 100000000000000"

before

Queries executed: 10.

localhost:9000, queries: 10, QPS: 0.178, RPS: 15784816.736, MiB/s: 286.673, result RPS: 1.780, result MiB/s: 0.000.

0%              5.368 sec.
10%             5.566 sec.
20%             5.583 sec.
30%             5.593 sec.
40%             5.626 sec.
50%             5.642 sec.
60%             5.642 sec.
70%             5.652 sec.
80%             5.676 sec.
90%             5.694 sec.
95%             5.698 sec.
99%             5.698 sec.
99.9%           5.698 sec.
99.99%          5.698 sec.

after

Queries executed: 10.

localhost:9000, queries: 10, QPS: 0.204, RPS: 18066175.748, MiB/s: 328.105, result RPS: 2.037, result MiB/s: 0.000.

0%              4.729 sec.
10%             4.768 sec.
20%             4.770 sec.
30%             4.863 sec.
40%             4.879 sec.
50%             4.935 sec.
60%             4.935 sec.
70%             4.972 sec.
80%             5.021 sec.
90%             5.025 sec.
95%             5.033 sec.
99%             5.033 sec.
99.9%           5.033 sec.
99.99%          5.033 sec.

@alexey-milovidov
alexey-milovidov merged commit 2808362 into ClickHouse:master Feb 15, 2026
131 checks passed
@robot-ch-test-poll3 robot-ch-test-poll3 added the pr-synced-to-cloud The PR is synced to the cloud repo label Feb 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors pr-not-for-changelog This PR should not be mentioned in the changelog 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