v.21.1New Features
New Storage Setting for MergeTree Tables: max_partitions_to_read and User Setting force_max_partition_limit
Now we have a new storage settingmax_partitions_to_readfor tables in the MergeTree family. It limits the max number of partitions that can be accessed in one query. A user settingforce_max_partition_limitis also added to enforce this constraint. #18712 (Amos Bird).
Why it matters
This feature helps prevent queries from scanning too many partitions at once, which can improve query performance and resource management by avoiding overly expensive or potentially runaway queries. The related user settingforce_max_partition_limit allows enforcing this partition access limit.How to use it
Set themax_partitions_to_read setting on MergeTree family tables to define the maximum allowed partitions to read in one query. Enable the force_max_partition_limit user setting to enforce this constraint strictly, causing queries that exceed the limit to fail.