max_execution_speed
The maximum number of execution rows per second. Checked on every data block whentimeout_before_checking_execution_speed
expires. If the execution speed is high, the execution speed will be reduced.
max_execution_speed_bytes
The maximum number of execution bytes per second. Checked on every data block whentimeout_before_checking_execution_speed
expires. If the execution speed is high, the execution speed will be reduced.
max_execution_time
The maximum query execution time in seconds. Themax_execution_time parameter can be a bit tricky to understand.
It operates based on interpolation relative to the current query execution speed
(this behaviour is controlled by timeout_before_checking_execution_speed).
ClickHouse will interrupt a query if the projected execution time exceeds the
specified max_execution_time. By default, the timeout_before_checking_execution_speed
is set to 10 seconds. This means that after 10 seconds of query execution, ClickHouse
will begin estimating the total execution time. If, for example, max_execution_time
is set to 3600 seconds (1 hour), ClickHouse will terminate the query if the estimated
time exceeds this 3600-second limit. If you set timeout_before_checking_execution_speed
to 0, ClickHouse will use the clock time as the basis for max_execution_time.
If query runtime exceeds the specified number of seconds, the behavior will be
determined by the ‘timeout_overflow_mode’, which by default is set to throw.
The timeout is checked and the query can stop only in designated places during data processing.
It currently cannot stop during merging of aggregation states or during query analysis,
and the actual run time will be higher than the value of this setting.
max_execution_time_leaf
Similar semantically tomax_execution_time but only
applied on leaf nodes for distributed or remote queries.
For example, if we want to limit the execution time on a leaf node to 10s but
have no limit on the initial node, instead of having max_execution_time in the
nested subquery settings:
max_execution_time_leaf as the query settings: