max_rows_for_lazy_final
Maximum number of rows in the set for lazy FINAL optimization. If exceeded, falls back to normal FINAL.max_rows_in_distinct
The maximum number of different rows when using DISTINCT.max_rows_in_join
Limits the number of rows in the right-side data structure (typically a hash table) used when joining tables. This setting applies to SELECT … JOIN operations and the Join table engine. If a query contains multiple joins, ClickHouse checks this setting for every intermediate result. When the limit is reached, the action depends on the chosenjoin_algorithm — see
that setting for the per-algorithm behavior (spill, re-partition, switch, or
throw/break per join_overflow_mode).
Possible values:
- Positive integer.
0— Unlimited number of rows.
max_rows_in_set
The maximum number of rows for a data set in the IN clause created from a subquery.max_rows_in_set_to_optimize_join
Maximal size of the set to filter joined tables by each other’s row sets before joining. Possible values:- 0 — Disable.
- Any positive integer.
max_rows_to_group_by
The maximum number of unique keys received from aggregation. This setting lets you limit memory consumption when aggregating. If aggregation during GROUP BY is generating more than the specified number of rows (unique GROUP BY keys), the behavior will be determined by the ‘group_by_overflow_mode’ which by default isthrow, but can be also switched
to an approximate GROUP BY mode.
max_rows_to_read
The maximum number of rows that can be read from a table when running a query. The restriction is checked for each processed chunk of data, applied only to the deepest table expression and when reading from a remote server, checked only on the remote server.max_rows_to_read_leaf
The maximum number of rows that can be read from a local table on a leaf node when running a distributed query. While distributed queries can issue multiple sub-queries to each shard (leaf) - this limit will be checked only on the read stage on the leaf nodes and ignored on the merging of results stage on the root node. For example, a cluster consists of 2 shards and each shard contains a table with 100 rows. The distributed query which is supposed to read all the data from both tables with settingmax_rows_to_read=150 will fail, as in total there will be
200 rows. A query with max_rows_to_read_leaf=150 will succeed, since leaf nodes
will read at max 100 rows.
The restriction is checked for each processed chunk of data.
This setting is unstable with
prefer_localhost_replica=1.max_rows_to_sort
The maximum number of rows before sorting. This allows you to limit memory consumption when sorting. If more than the specified amount of records have to be processed for the ORDER BY operation, the behavior will be determined by thesort_overflow_mode which by default is set to throw.