From 305339640e66562a758cd9a1dd1da5985a11783a Mon Sep 17 00:00:00 2001 From: zhyass Date: Sun, 15 Oct 2023 17:48:54 +0800 Subject: [PATCH] remove checkout prefect block --- src/query/expression/src/utils/block_thresholds.rs | 5 ----- .../src/processors/transforms/transform_block_compact.rs | 4 ++-- src/query/storages/fuse/src/statistics/cluster_statistics.rs | 2 +- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/query/expression/src/utils/block_thresholds.rs b/src/query/expression/src/utils/block_thresholds.rs index a5a496a9e5d50..3806140a8450d 100644 --- a/src/query/expression/src/utils/block_thresholds.rs +++ b/src/query/expression/src/utils/block_thresholds.rs @@ -46,11 +46,6 @@ impl BlockThresholds { } } - #[inline] - pub fn check_perfect_block(&self, row_count: usize, block_size: usize) -> bool { - row_count <= self.max_rows_per_block && self.check_large_enough(row_count, block_size) - } - #[inline] pub fn check_large_enough(&self, row_count: usize, block_size: usize) -> bool { row_count >= self.min_rows_per_block || block_size >= self.max_bytes_per_block diff --git a/src/query/pipeline/transforms/src/processors/transforms/transform_block_compact.rs b/src/query/pipeline/transforms/src/processors/transforms/transform_block_compact.rs index bf9670caed8a7..8338e38811836 100644 --- a/src/query/pipeline/transforms/src/processors/transforms/transform_block_compact.rs +++ b/src/query/pipeline/transforms/src/processors/transforms/transform_block_compact.rs @@ -63,7 +63,7 @@ impl Compactor for BlockCompactor { // perfect block if self .thresholds - .check_perfect_block(block.num_rows(), block.memory_size()) + .check_large_enough(block.num_rows(), block.memory_size()) { res.push(block); blocks.remove(size - 1); @@ -109,7 +109,7 @@ impl Compactor for BlockCompactor { // Perfect block, no need to compact if self .thresholds - .check_perfect_block(block.num_rows(), block.memory_size()) + .check_large_enough(block.num_rows(), block.memory_size()) { res.push(block.clone()); } else { diff --git a/src/query/storages/fuse/src/statistics/cluster_statistics.rs b/src/query/storages/fuse/src/statistics/cluster_statistics.rs index 9b1411b24802a..a78964ff5b74b 100644 --- a/src/query/storages/fuse/src/statistics/cluster_statistics.rs +++ b/src/query/storages/fuse/src/statistics/cluster_statistics.rs @@ -156,7 +156,7 @@ impl ClusterStatsGenerator { let level = if min == max && self .block_thresholds - .check_perfect_block(data_block.num_rows(), data_block.memory_size()) + .check_large_enough(data_block.num_rows(), data_block.memory_size()) { -1 } else {