From f70095367723a0c9d7011787787006731c291439 Mon Sep 17 00:00:00 2001 From: CookiePieWw Date: Sat, 7 Dec 2024 23:52:14 +0800 Subject: [PATCH] chore: typo --- src/mito2/src/cache.rs | 2 +- src/mito2/src/cache/index.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mito2/src/cache.rs b/src/mito2/src/cache.rs index ce592ec686f3..55aee5b15400 100644 --- a/src/mito2/src/cache.rs +++ b/src/mito2/src/cache.rs @@ -54,7 +54,7 @@ const FILE_TYPE: &str = "file"; const SELECTOR_RESULT_TYPE: &str = "selector_result"; /// Page size for cache. Currently only used for inverted index cache. -const PAGE_SIZE: usize = 8192 * 1024; // 4MB +const PAGE_SIZE: usize = 8192 * 1024; // 8MB /// Manages cached data for the engine. /// diff --git a/src/mito2/src/cache/index.rs b/src/mito2/src/cache/index.rs index f560d57f0529..749d0dacc881 100644 --- a/src/mito2/src/cache/index.rs +++ b/src/mito2/src/cache/index.rs @@ -172,12 +172,12 @@ impl IndexKey { } /// Ranges of last page. - /// For example, if offset is 1000 and size is 2000, then the last page is 0..904. + /// For example, if offset is 1000 and size is 5000 and PAGE_SIZE is 4096, then the last page is 0..904. fn offset_to_last_range(_offset: u64, size: u32) -> Range { 0..(size % (PAGE_SIZE as u32)) as usize } - pub fn index(file_id: FileId, offset: u64, size: u32) -> Vec { + fn index(file_id: FileId, offset: u64, size: u32) -> Vec { let page_id = Self::offset_to_page_id(offset); let page_num = Self::size_to_page_num(size); (0..page_num)