From a3f097f100cd60fd64602db8841ed9b0f3edbca1 Mon Sep 17 00:00:00 2001 From: Pavel Emelyanov Date: Thu, 9 Apr 2026 15:48:23 +0300 Subject: [PATCH] cql3: Move enable_parallelized_aggregation to cql_config The enable_parallelized_aggregation option controls whether aggregation queries are fanned out across shards for parallel execution. It belongs in cql_config rather than db::config as it directly governs CQL query behavior at prepare time. Signed-off-by: Pavel Emelyanov Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- cql3/cql_config.hh | 3 +++ cql3/statements/select_statement.cc | 3 +-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cql3/cql_config.hh b/cql3/cql_config.hh index 962ac5a706..f1edf5849d 100644 --- a/cql3/cql_config.hh +++ b/cql3/cql_config.hh @@ -22,17 +22,20 @@ struct cql_config { restrictions::restrictions_config restrictions; utils::updateable_value select_internal_page_size; utils::updateable_value strict_allow_filtering; + utils::updateable_value enable_parallelized_aggregation; explicit cql_config(const db::config& cfg) : restrictions(cfg) , select_internal_page_size(cfg.select_internal_page_size) , strict_allow_filtering(cfg.strict_allow_filtering) + , enable_parallelized_aggregation(cfg.enable_parallelized_aggregation) {} struct default_tag{}; cql_config(default_tag) : restrictions(restrictions::restrictions_config::default_tag{}) , select_internal_page_size(10000) , strict_allow_filtering(db::tri_mode_restriction(db::tri_mode_restriction_t::mode::WARN)) + , enable_parallelized_aggregation(true) {} }; diff --git a/cql3/statements/select_statement.cc b/cql3/statements/select_statement.cc index 8effd63608..c2d25c83f5 100644 --- a/cql3/statements/select_statement.cc +++ b/cql3/statements/select_statement.cc @@ -60,7 +60,6 @@ #include "utils/result_loop.hh" #include "replica/database.hh" #include "replica/mutation_dump.hh" -#include "db/config.hh" #include "cql3/cql_config.hh" @@ -2470,7 +2469,7 @@ std::unique_ptr select_statement::prepare(data_dictionary::d ) && !restrictions->need_filtering() // No filtering && group_by_cell_indices->empty() // No GROUP BY - && db.get_config().enable_parallelized_aggregation() + && cfg.enable_parallelized_aggregation() && !is_local_table() && !( // Do not parallelize the request if it's single partition read restrictions->partition_key_restrictions_is_all_eq()