This is an automated email from the ASF dual-hosted git repository.

dataroaring pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new d3b10bb2460 [Opt](config) Add a config for min buffer size to flush 
for partial update (#53841)
d3b10bb2460 is described below

commit d3b10bb2460a3e865929d6f041929ee63b4a4eb6
Author: bobhan1 <bao...@selectdb.com>
AuthorDate: Sat Jul 26 15:59:00 2025 +0800

    [Opt](config) Add a config for min buffer size to flush for partial update 
(#53841)
---
 be/src/common/config.cpp | 2 ++
 be/src/common/config.h   | 2 ++
 be/src/olap/memtable.cpp | 3 ++-
 3 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/be/src/common/config.cpp b/be/src/common/config.cpp
index 0401eeae23d..367491bbbef 100644
--- a/be/src/common/config.cpp
+++ b/be/src/common/config.cpp
@@ -686,6 +686,8 @@ DEFINE_mInt32(memory_gc_sleep_time_ms, "500");
 DEFINE_mInt64(write_buffer_size, "209715200");
 // max buffer size used in memtable for the aggregated table, default 400MB
 DEFINE_mInt64(write_buffer_size_for_agg, "419430400");
+
+DEFINE_mInt64(min_write_buffer_size_for_partial_update, "1048576");
 // max parallel flush task per memtable writer
 DEFINE_mInt32(memtable_flush_running_count_limit, "2");
 
diff --git a/be/src/common/config.h b/be/src/common/config.h
index bf462d9b14f..271dee612e0 100644
--- a/be/src/common/config.h
+++ b/be/src/common/config.h
@@ -711,6 +711,8 @@ DECLARE_mInt32(memory_gc_sleep_time_ms);
 DECLARE_mInt64(write_buffer_size);
 // max buffer size used in memtable for the aggregated table, default 400MB
 DECLARE_mInt64(write_buffer_size_for_agg);
+
+DECLARE_mInt64(min_write_buffer_size_for_partial_update);
 // max parallel flush task per memtable writer
 DECLARE_mInt32(memtable_flush_running_count_limit);
 
diff --git a/be/src/olap/memtable.cpp b/be/src/olap/memtable.cpp
index 532fb0f4da6..e8d2904c2bb 100644
--- a/be/src/olap/memtable.cpp
+++ b/be/src/olap/memtable.cpp
@@ -654,8 +654,9 @@ bool MemTable::need_flush() const {
     auto max_size = config::write_buffer_size;
     if (_partial_update_mode == UniqueKeyUpdateModePB::UPDATE_FIXED_COLUMNS) {
         auto update_columns_size = _num_columns;
+        auto min_buffer_size = 
config::min_write_buffer_size_for_partial_update;
         max_size = max_size * update_columns_size / 
_tablet_schema->num_columns();
-        max_size = max_size > 1048576 ? max_size : 1048576;
+        max_size = max_size > min_buffer_size ? max_size : min_buffer_size;
     }
     return memory_usage() >= max_size;
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to