Zoltan Borok-Nagy has uploaded this change for review. ( 
https://gerrit.cloudera.org/25585


Change subject: PROTOTYPE IMPALA-15841: Do not clamp the producer cost per row 
in CPC
......................................................................

PROTOTYPE IMPALA-15841: Do not clamp the producer cost per row in CPC

When COMPUTE_PROCESSING_COST matches a consumer fragment to its
producer, ProcessingCost.consumerProducerRatio() divided the
consumer's cost per row by max(1, producer cost per row). Producers
often cost less than 1 per row, e.g. a scan of a few narrow columns,
so the ratio and the consumer's instance count came out too low. With
CPC_BROADCAST_DOP=-1, a partitioned join fragment of a skewed TPC-H
variant was planned at 12 instances, one per node, instead of 23.

The ratio now uses the producer cost per row as is. The only caller
already skips producers that cost 0 per row.

This is the last of a series of COMPUTE_PROCESSING_COST (CPC) costing
prototypes. A prototype of the whole series, run with
CPC_BROADCAST_DOP=-1 against master with CPC on 3 executors with 64
vCPUs each, cuts the TPC-H SF1000 total by 6.0% (q3 -37%, q7 -62%).
Without q4, q9, q13 and q21, which a slow impalad restart slows, it
saves 28.7 s, and 31.1 and 34.8 s in two repeats, more than 5x the
run-to-run noise. In single runs, where a total within 6% is noise,
TPC-DS SF10000 takes 3.3% less on the 102 queries master completes
and also runs q14_1 (815 s). Two other workloads change by -6.5% and
+2.7%. A TPC-H SF1000 variant with skewed keys
takes 16.4% more on 19 queries: CPC_BROADCAST_DOP=-1 makes the
orders x lineitem join of q10 partitioned on l_orderkey, the skewed
keys put 155M rows into one instance, and the median of q10 goes from
54 s to 200 s, and q3 from 25 s to 47 s.

Testing:
- New ProcessingCostTest case, fails without the fix.
- Updated the CPC planner goldens of 9 TPC-DS queries; only instance
  counts and the derived resource numbers change.
- Planned TPC-H, TPC-DS and a skewed TPC-H variant for 12 executors
  with 16 cores: instance counts rise in 8 queries and fall in none.

Change-Id: Ib7e9ebe15a03e58a3bcac4ea55ee3f7081e17603
Assisted-by: Claude Opus 5.5 (Claude Code)
---
M fe/src/main/java/org/apache/impala/planner/ProcessingCost.java
M fe/src/test/java/org/apache/impala/planner/ProcessingCostTest.java
M 
testdata/workloads/functional-planner/queries/PlannerTest/tpcds_cpu_cost/tpcds-q17.test
M 
testdata/workloads/functional-planner/queries/PlannerTest/tpcds_cpu_cost/tpcds-q24a.test
M 
testdata/workloads/functional-planner/queries/PlannerTest/tpcds_cpu_cost/tpcds-q24b.test
M 
testdata/workloads/functional-planner/queries/PlannerTest/tpcds_cpu_cost/tpcds-q25.test
M 
testdata/workloads/functional-planner/queries/PlannerTest/tpcds_cpu_cost/tpcds-q29.test
M 
testdata/workloads/functional-planner/queries/PlannerTest/tpcds_cpu_cost/tpcds-q40.test
M 
testdata/workloads/functional-planner/queries/PlannerTest/tpcds_cpu_cost/tpcds-q49.test
M 
testdata/workloads/functional-planner/queries/PlannerTest/tpcds_cpu_cost/tpcds-q64-mem_limit-10g.test
M 
testdata/workloads/functional-planner/queries/PlannerTest/tpcds_cpu_cost/tpcds-q64-mem_limit_executors-20g.test
M 
testdata/workloads/functional-planner/queries/PlannerTest/tpcds_cpu_cost/tpcds-q64.test
M 
testdata/workloads/functional-planner/queries/PlannerTest/tpcds_cpu_cost/tpcds-q80.test
M 
testdata/workloads/functional-planner/queries/PlannerTest/tpcds_tuple_cache/tpcds-q17.test
M 
testdata/workloads/functional-planner/queries/PlannerTest/tpcds_tuple_cache/tpcds-q24a.test
M 
testdata/workloads/functional-planner/queries/PlannerTest/tpcds_tuple_cache/tpcds-q24b.test
M 
testdata/workloads/functional-planner/queries/PlannerTest/tpcds_tuple_cache/tpcds-q25.test
M 
testdata/workloads/functional-planner/queries/PlannerTest/tpcds_tuple_cache/tpcds-q29.test
M 
testdata/workloads/functional-planner/queries/PlannerTest/tpcds_tuple_cache/tpcds-q40.test
M 
testdata/workloads/functional-planner/queries/PlannerTest/tpcds_tuple_cache/tpcds-q49.test
M 
testdata/workloads/functional-planner/queries/PlannerTest/tpcds_tuple_cache/tpcds-q64.test
M 
testdata/workloads/functional-planner/queries/PlannerTest/tpcds_tuple_cache/tpcds-q80.test
22 files changed, 1,633 insertions(+), 1,615 deletions(-)



  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/85/25585/1
--
To view, visit https://gerrit.cloudera.org/25585
To unsubscribe, visit https://gerrit.cloudera.org/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib7e9ebe15a03e58a3bcac4ea55ee3f7081e17603
Gerrit-Change-Number: 25585
Gerrit-PatchSet: 1
Gerrit-Owner: Zoltan Borok-Nagy <[email protected]>

Reply via email to