From af1df2066c151ddf8d23266e42a1da4e6d64c92e Mon Sep 17 00:00:00 2001 From: Ruihang Xia Date: Tue, 8 Nov 2022 11:23:10 +0800 Subject: [PATCH] perf: enlarge write row group size (#413) Signed-off-by: Ruihang Xia --- src/storage/src/flush.rs | 3 +++ src/store-api/src/storage/consts.rs | 2 ++ 2 files changed, 5 insertions(+) diff --git a/src/storage/src/flush.rs b/src/storage/src/flush.rs index db9714cb2f..263d5becfe 100644 --- a/src/storage/src/flush.rs +++ b/src/storage/src/flush.rs @@ -4,6 +4,7 @@ use async_trait::async_trait; use common_telemetry::logging; use common_time::RangeMillis; use store_api::logstore::LogStore; +use store_api::storage::consts::WRITE_ROW_GROUP_SIZE; use store_api::storage::SequenceNumber; use uuid::Uuid; @@ -164,6 +165,8 @@ impl FlushJob { let mut futures = Vec::with_capacity(self.memtables.len()); let iter_ctx = IterContext { for_flush: true, + // TODO(ruihang): dynamic row group size based on content (#412) + batch_size: WRITE_ROW_GROUP_SIZE, ..Default::default() }; for m in &self.memtables { diff --git a/src/store-api/src/storage/consts.rs b/src/store-api/src/storage/consts.rs index 4d353ba460..70473973fb 100644 --- a/src/store-api/src/storage/consts.rs +++ b/src/store-api/src/storage/consts.rs @@ -79,6 +79,8 @@ pub const OP_TYPE_COLUMN_NAME: &str = "__op_type"; pub const READ_BATCH_SIZE: usize = 256; +pub const WRITE_ROW_GROUP_SIZE: usize = 4096; + // ----------------------------------------------------------------------------- #[cfg(test)]