Set max_parallel_replicas to 1 when disabling

This commit is contained in:
Raúl Marín 2024-02-27 12:35:14 +01:00 committed by GitHub
parent c395e4f52f
commit c9dd6fe8d5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -885,7 +885,7 @@ bool InterpreterSelectQuery::adjustParallelReplicasAfterAnalysis()
{ {
/// The query could use trivial count if it didn't use parallel replicas, so let's disable it and reanalyze /// The query could use trivial count if it didn't use parallel replicas, so let's disable it and reanalyze
context->setSetting("allow_experimental_parallel_reading_from_replicas", Field(0)); context->setSetting("allow_experimental_parallel_reading_from_replicas", Field(0));
context->setSetting("max_parallel_replicas", UInt64{0}); context->setSetting("max_parallel_replicas", UInt64{1});
LOG_DEBUG(log, "Disabling parallel replicas to be able to use a trivial count optimization"); LOG_DEBUG(log, "Disabling parallel replicas to be able to use a trivial count optimization");
return true; return true;
} }