We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 385ca4e commit 6479edcCopy full SHA for 6479edc
src/batch/mod.rs
@@ -1,4 +1,8 @@
1
-use crate::{value::ValueType, Tree, Value};
+use crate::{
2
+ value::{UserData, UserKey, ValueType},
3
+ Tree, Value,
4
+};
5
+use std::sync::Arc;
6
7
/// An atomic write batch
8
pub struct Batch {
@@ -55,7 +59,9 @@ impl Batch {
55
59
56
60
// NOTE: Add some pointers to better approximate memory usage of memtable
57
61
// Because the data is stored with less overhead than in memory
58
- let size = bytes_written_to_disk + (items.len() * std::mem::size_of::<Vec<u8>>() * 2);
62
+ let size = bytes_written_to_disk
63
+ + (items.len() * (std::mem::size_of::<UserKey>() + std::mem::size_of::<UserData>()));
64
+
65
let memtable_size = self
66
.tree
67
.approx_active_memtable_size
0 commit comments