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 <xemul@scylladb.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Pavel Emelyanov
2026-04-09 15:48:23 +03:00
parent 4314fc0642
commit a3f097f100
2 changed files with 4 additions and 2 deletions

View File

@@ -22,17 +22,20 @@ struct cql_config {
restrictions::restrictions_config restrictions;
utils::updateable_value<uint32_t> select_internal_page_size;
utils::updateable_value<db::tri_mode_restriction> strict_allow_filtering;
utils::updateable_value<bool> 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)
{}
};

View File

@@ -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<prepared_statement> 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()