Skip to main content
These settings are available in system.settings and are autogenerated from source.

automatic_parallel_replicas_ignore_thresholds

For testing of the automatic parallel replicas cost model - ignore the cap on how many threads a read can usefully occupy (derived from merge_tree_min_bytes_per_task_for_remote_reading), which otherwise clamps both sides of the comparison to the same value for a read too small to occupy max_threads, so that the comparison collapses to 0 > output_bytes / replicas and the query is decided before the cost model is consulted. It deliberately does NOT touch automatic_parallel_replicas_min_bytes_per_replica: set that to 0 to disable that gate, which is what it is for. Nor does it change read task sizing, or suppress the recollection of statistics that have drifted - a decision made on stale statistics is not a decision made by the cost model.

automatic_parallel_replicas_max_duplicated_read_ratio

How much of a query’s read volume may be read by every replica instead of being split between them, as a fraction of the whole, before automatic parallel replicas declines the query. Only the read parallel replicas coordinate is split; every other read of the same subtree runs on each replica in full. Those reads take the same wall-clock time either way, so the cost-model comparison is blind to them, but the cluster performs max_parallel_replicas times as much work for them. This setting is the limit on that waste: at the default 0.5 a query whose coordinated read is less than half of what it reads keeps running on one node, however the time comparison turns out. Set to 1 to accept any amount of duplicated reading, which restores the behaviour of only comparing times.

automatic_parallel_replicas_min_bytes_per_replica

Threshold of bytes to read per replica to enable parallel replicas automatically (applies only when automatic_parallel_replicas_mode=1). 0 means no threshold. The total number of bytes to read is estimated based on the collected statistics.

automatic_parallel_replicas_mode

Enable automatic switching to execution with parallel replicas based on collected statistics. Requires enable_parallel_replicas = 1, parallel_replicas_local_plan = 1 and providing cluster_for_parallel_replicas. With enable_parallel_replicas = 2 parallel replicas are forced and the automatic mode is not applied. 0 - disabled, 1 - enabled, 2 - only statistics collection is enabled (switching to execution with parallel replicas is disabled).

automatic_parallel_replicas_remember_boundary

Lets automatic parallel replicas remember, per query plan, where the replicas’ share of the work ends, so that a repeated query whose statistics decline parallel replicas is decided without building the plan with parallel replicas. Disables remembered boundaries. To benchmark the cost of building the plan with parallel replicas, also set automatic_parallel_replicas_undecided_retry_after_executions = 0: the plans whose last build ended without a decision are skipped independently of this setting.

automatic_parallel_replicas_statistics_drift_ratio

How much the rows a read selects may differ from the rows it selected when automatic parallel replicas collected its statistics, as the ratio of the larger to the smaller, before the statistics are considered stale and collected again instead of being decided on. The rows are the ones the initiator’s index analysis selects, so pruning that only the replicas do while reading (for example by their own query condition caches) is not seen. A lower ratio recollects the statistics sooner as the table changes. Should be greater than 1.

automatic_parallel_replicas_undecided_retry_after_executions

How many executions of a query plan skip building the plan with parallel replicas after its last build ended without a decision in automatic parallel replicas: the two plans could not be compared, the planner used no parallel replicas in the plan built with them, a step of the plan cannot collect the statistics, or the collection measured nothing. Concurrent executions take turns: one in every automatic_parallel_replicas_undecided_retry_after_executions + 1 builds the plan again. After the first such outcome for a query plan, the next execution builds the plan again at once just in case the first execution populated other statistics caches and the planning decisions will change. 0 disables deferral after undecided outcomes. It is independent of automatic_parallel_replicas_remember_boundary, which spares the build for plans decided from statistics.