From 0e5d7d40873112daa6de89b539275bfcd1400a3c Mon Sep 17 00:00:00 2001 From: James Bartlett Date: Wed, 16 Aug 2023 08:23:17 -0700 Subject: [PATCH] [planner] Enable partial aggregates (#1676) Summary: Flips the switch to enable partial aggregates. This should improve query performance. Relevant Issues: Fixes #1440 Type of change: /kind feature Test Plan: Tested by skaffolding to a cluster. Saw that `px/cluster` and other scripts return reasonable results. Compared the node CPU % from `px/cluster` (calculated through an aggregate) to the actual usage on the node. Also, used `px:set explain=true` `px:set analyze=true` to check that the query plan was using partial aggregates. Changelog Message: ```release-note Queries now support partial aggregates which should improve query performance significantly in some cases. ``` Signed-off-by: James Bartlett --- src/carnot/planner/distributed/coordinator/coordinator.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/carnot/planner/distributed/coordinator/coordinator.cc b/src/carnot/planner/distributed/coordinator/coordinator.cc index 2de0fddf4ee..bfa67ac5f93 100644 --- a/src/carnot/planner/distributed/coordinator/coordinator.cc +++ b/src/carnot/planner/distributed/coordinator/coordinator.cc @@ -178,9 +178,8 @@ StatusOr LoadSchemaMap( } StatusOr> CoordinatorImpl::CoordinateImpl(const IR* logical_plan) { - // TODO(zasgar) set support_partial_agg to true to enable partial aggs. PX_ASSIGN_OR_RETURN(std::unique_ptr splitter, - Splitter::Create(compiler_state_, /* support_partial_agg */ false)); + Splitter::Create(compiler_state_, /* support_partial_agg */ true)); PX_ASSIGN_OR_RETURN(std::unique_ptr split_plan, splitter->SplitKelvinAndAgents(logical_plan)); auto distributed_plan = std::make_unique();