Overview
As part of the settings, ClickHouse offers the ability to place restrictions on query complexity. This helps protect against potentially resource-intensive queries, ensuring safer and more predictable execution, particularly when using the user interface. Almost all the restrictions only apply toSELECT queries, and for distributed
query processing, restrictions are applied on each server separately.
ClickHouse generally checks the restrictions only after data parts have been
fully processed, rather than checking the restrictions for each row. This can
result in a situation where restrictions are violated while the part is being
processed.
overflow_mode settings
Most restrictions also have an overflow_mode setting, which defines what happens
when the limit is exceeded, and can take one of two values:
throw: throw an exception (default).break: stop executing the query and return the partial result, as if the source data ran out.
group_by_overflow_mode settings
The group_by_overflow_mode setting also has
the value any:
any: continue aggregation for the keys that got into the set, but do not add new keys to the set.
List of settings
The following settings are used for applying restrictions on query complexity.Restrictions on the “maximum amount of something” can take a value of
0,
which means that it is “unrestricted”.Obsolete settings
The following settings are obsolete