Joins are often one of the most expensive parts of a query. Once tables get large, the join can heavily impact both runtime and memory usage, especially when the engine has to build a large hash table as part of execution. If the join keys are already sorted, Polars can now take a cheaper path: a streaming sort-merge join. This post explains how that algorithm works, how to make use of it, how to verify that Polars chose the merge-join using the physical plan, and when this path is worth using.
Is this you? As a journalist, you can create a free Muck Rack account to customize your profile, list your contact preferences, and upload a portfolio of your best work.
Claim your profile
Get in touch with Import
Contact Import, search articles and posts on X, monitor coverage, and track replies from one place.
Learn more about Muck Rack