concurrent_threads_lazy_allocation
Controls how CPU slots are allocated to queries. Whentrue (default), a query starts with one CPU slot and requests additional slots from the scheduler only when its pipeline actually pushes more parallelizable work. This avoids the situation where a query reserves up to max_threads slots but only ever uses a fraction of them, starving other concurrent queries. Applies both to concurrency control and to the preemptive CPU scheduler for workloads.
When false, the query requests all max_threads slots up front at start.
concurrent_threads_scheduler
The policy on how to perform a scheduling of CPU slots specified byconcurrent_threads_soft_limit_num and concurrent_threads_soft_limit_ratio_to_cores. Algorithm used to govern how limited number of CPU slots are distributed among concurrent queries. Scheduler may be changed at runtime without server restart.
Possible values:
round_robin— Every query with settinguse_concurrency_control= 1 allocates up tomax_threadsCPU slots. One slot per thread. On contention CPU slot are granted to queries using round-robin. Note that the first slot is granted unconditionally, which could lead to unfairness and increased latency of queries having highmax_threadsin presence of high number of queries withmax_threads= 1.fair_round_robin— Every query with settinguse_concurrency_control= 1 allocates up tomax_threads - 1CPU slots. Variation ofround_robinthat does not require a CPU slot for the first thread of every query. This way queries havingmax_threads= 1 do not require any slot and could not unfairly allocate all slots. There are no slots granted unconditionally.max_min_fair— Every query with settinguse_concurrency_control= 1 allocates up tomax_threads - 1CPU slots. Similar tofair_round_robin, but released slots are always granted to the query with the minimum number of currently allocated slots. This provides better fairness under high oversubscription, where many queries compete for limited CPU slots. Short-running queries are not penalized by long-running queries that have accumulated more slots over time.
concurrent_threads_soft_limit_num
The maximum number of query processing threads, excluding threads for retrieving data from remote servers, allowed to run all queries. This is not a hard limit. In case if the limit is reached the query will still get at least one thread to run. Query can upscale to desired number of threads during execution if more threads become available.A value of
0 (default) means unlimited.concurrent_threads_soft_limit_ratio_to_cores
Same asconcurrent_threads_soft_limit_num, but with ratio to cores.