Repository navigation
External IN (1/2) - #123860
Merged
Merged
External IN (1/2)#123860
IN (1/2)#123860Conversation
…SortingTransform`
…nal_set` settings
…xBytesBeforeExternalProcessing`
…ingSetsTransform`
…ng the set in memory
…onal column name
…Chunks` mode of `MergeSortingTransform`
…into static `updateHashWithStringValue`
… removes repeated keys
…spill to disk yet
…_in_forms`, over three partitions
…eduplication` without empty blocks
vdimir
approved these changes
Oct 8, 2026
…o local execution
Member
Author
|
Build (arm_fuzzers) failure fix: |
Merged
via the queue into
ClickHouse:master
with commit Oct 9, 2026
0994a31
162 of 163 checks passed
PedroTadim
added a commit
that referenced
this pull request
Oct 9, 2026
…top-K dynamic filtering settings - `max_bytes_before_external_set` / `max_bytes_ratio_before_external_set` join the external sort/group by/distinct family. The bytes threshold is drawn low (1 byte to 64 MiB) so that sets actually spill. - `enable_join_seal_gated_reading` (experimental) is enabled with 30% probability. - `enable_group_by_top_k_dynamic_filtering` is disabled with 5% probability. The last two are forced off when their parent settings are off. Related: #123860 Related: #113512 Related: #121145 Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related: #116569
The sets of
INbuilt from a subquery or a table can now spill to disk while they are filled, asORDER BY,GROUP BY,JOINandDISTINCTalready do.Every set of
INthat is filled while the query runs can spill:WHERE,PREWHERE,HAVING, theSELECTlist, lambdas andJOIN ON;INSERT ... SELECT, views, materialized views, refreshable materialized views and dictionary sources;ALTER TABLE ... DELETE,ALTER TABLE ... UPDATEand lightweightDELETE. The parts of a mutation share a spilled set through the prepared sets cache, as they share a set in memory;GLOBAL INand the set that the conversion ofJOINtoINbuilds.These sets stay in memory:
x IN (1, 2, 3)andSettables, which the query does not build;FINAL, which serves only index analysis and needs its values;GLOBAL INon the initiator and the shards. The set that a shard builds from it can spill.This PR only has a very basic disk based set. Future improvements are planned and will come in a separate PR.
Since disk set of this version is basic, and spilling is off by default.
Optimizing it is planned for follow-up PRs: a membership filter that skips reads for misses, sorted probe batches across chunks, reused readers and a block cache, integer encodings of the blocks, and more.
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
The sets of
INwith a subquery or a table can now spill to disk, once the tracked memory of the query exceedsmax_bytes_before_external_setbytes or themax_bytes_ratio_before_external_setfraction of the available server or user memory. Both settings are0by default, which keeps sets in memory.Workflow [PR]
Sync PR [sync-upstream/pr/123860]
Version info
26.10.1.1924-master(included in26.10and later)