File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
src/query/pipeline/transforms/src/processors/transforms
tests/suites/0_stateless/20+_others Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,9 @@ use crate::processors::sort::SortSpillMetaWithParams;
63
63
/// A spilled block file is at most 8MB.
64
64
const SPILL_BATCH_BYTES_SIZE : usize = 8 * 1024 * 1024 ;
65
65
66
+ /// The memory will be doubled during merging.
67
+ const MERGE_RATIO : usize = 2 ;
68
+
66
69
pub trait MergeSort < R : Rows > {
67
70
const NAME : & ' static str ;
68
71
@@ -234,9 +237,8 @@ where
234
237
self . next_index += 1 ;
235
238
236
239
self . inner . add_block ( block, cursor) ?;
237
-
238
240
let blocks = if self . may_spill
239
- && ( self . inner . num_bytes ( ) >= self . spilling_bytes_threshold
241
+ && ( self . inner . num_bytes ( ) * MERGE_RATIO >= self . spilling_bytes_threshold
240
242
|| GLOBAL_MEM_STAT . get_memory_usage ( ) as usize >= self . max_memory_usage )
241
243
{
242
244
self . prepare_spill ( ) ?
Original file line number Diff line number Diff line change 71
71
NULL NULL
72
72
2 5
73
73
===================
74
- 6
74
+ 9
You can’t perform that action at this time.
0 commit comments