From 8a357d93a6fc4c19fbbc8caaaacdcde54ec7f9f8 Mon Sep 17 00:00:00 2001 From: evenyag Date: Tue, 3 Dec 2024 15:59:01 +0800 Subject: [PATCH] feat: get uppoer bound for part nums --- src/query/src/optimizer/parallelize_scan.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/query/src/optimizer/parallelize_scan.rs b/src/query/src/optimizer/parallelize_scan.rs index 46b016982f..ec5d813eac 100644 --- a/src/query/src/optimizer/parallelize_scan.rs +++ b/src/query/src/optimizer/parallelize_scan.rs @@ -131,7 +131,7 @@ impl ParallelizeScan { let total_rows = ranges.iter().map(|range| range.num_rows).sum::(); // Computes the partition num by the max row number. This eliminates the unbalance of the partitions. let balanced_partition_num = if max_rows > 0 { - total_rows / max_rows + (total_rows + max_rows - 1) / max_rows } else { ranges.len() };