mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-01-07 13:52:59 +00:00
chore(mito): set null value data size to i64 (#3722)
* chore(mito): set null value data size to i64 * chore(mito): move comment to a relevant place
This commit is contained in:
@@ -1230,7 +1230,9 @@ impl<'a> ValueRef<'a> {
|
||||
/// The size is estimated and only considers the data size.
|
||||
pub fn data_size(&self) -> usize {
|
||||
match *self {
|
||||
ValueRef::Null => 0,
|
||||
// Since the `Null` type is also considered to occupy space, we have opted to use the
|
||||
// size of `i64` as an initial approximation.
|
||||
ValueRef::Null => 8,
|
||||
ValueRef::Boolean(_) => 1,
|
||||
ValueRef::UInt8(_) => 1,
|
||||
ValueRef::UInt16(_) => 2,
|
||||
@@ -2339,6 +2341,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn test_value_ref_estimated_size() {
|
||||
check_value_ref_size_eq(&ValueRef::Null, 8);
|
||||
check_value_ref_size_eq(&ValueRef::Boolean(true), 1);
|
||||
check_value_ref_size_eq(&ValueRef::UInt8(1), 1);
|
||||
check_value_ref_size_eq(&ValueRef::UInt16(1), 2);
|
||||
|
||||
Reference in New Issue
Block a user