Content Deep Dive
ClickHouse Joins Under the Hood - Full Sorting Merge Join, Partial Merge Join - MergingSortedTransform
Blog post from ClickHouse
Post Details
Company
Date Published
Author
Tom Schreiber
Word Count
7,058
Language
English
Hacker News Points
-
Summary
The Full sorting merge join algorithm is non-memory bound and can take advantage of the physical row order of the joined tables, skipping the sorting phase in such cases. It generally requires less memory than hash join algorithms but may have reduced execution speed if the data blocks are not already sorted by the join key. The partial merge join algorithm is optimized for minimizing memory usage when large tables are joined and always fully sorts the right table first via external sorting. This optimization allows it to skip the need for in-memory sorting, reducing memory consumption at the expense of relatively slower execution speed.