Skip to content

Commit

Permalink
use scalar for file shape; increase shape for small-type columns
Browse files Browse the repository at this point in the history
Signed-off-by: Jason Volk <[email protected]>
  • Loading branch information
jevolk committed Jan 25, 2025
1 parent 2b5edba commit 3d1816f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/database/engine/cf_opts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ fn descriptor_cf_options(
opts.set_write_buffer_size(desc.write_size);

opts.set_target_file_size_base(desc.file_size);
opts.set_target_file_size_multiplier(desc.file_shape[0]);
opts.set_target_file_size_multiplier(desc.file_shape);

opts.set_level_zero_file_num_compaction_trigger(desc.level0_width);
opts.set_level_compaction_dynamic_level_bytes(false);
Expand Down
6 changes: 4 additions & 2 deletions src/database/engine/descriptor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pub(crate) struct Descriptor {
pub(crate) level_size: u64,
pub(crate) level_shape: [i32; 7],
pub(crate) file_size: u64,
pub(crate) file_shape: [i32; 1],
pub(crate) file_shape: i32,
pub(crate) level0_width: i32,
pub(crate) merge_width: (i32, i32),
pub(crate) ttl: u64,
Expand Down Expand Up @@ -59,7 +59,7 @@ pub(crate) static BASE: Descriptor = Descriptor {
level_size: 1024 * 1024 * 8,
level_shape: [1, 1, 1, 3, 7, 15, 31],
file_size: 1024 * 1024,
file_shape: [2],
file_shape: 2,
level0_width: 2,
merge_width: (2, 16),
ttl: 60 * 60 * 24 * 21,
Expand Down Expand Up @@ -106,6 +106,7 @@ pub(crate) static RANDOM_SMALL: Descriptor = Descriptor {
write_size: 1024 * 1024 * 16,
level_size: 1024 * 512,
file_size: 1024 * 128,
file_shape: 3,
index_size: 512,
block_size: 512,
cache_shards: 64,
Expand All @@ -121,6 +122,7 @@ pub(crate) static SEQUENTIAL_SMALL: Descriptor = Descriptor {
write_size: 1024 * 1024 * 16,
level_size: 1024 * 1024,
file_size: 1024 * 512,
file_shape: 3,
block_size: 512,
cache_shards: 64,
block_index_hashing: Some(false),
Expand Down

0 comments on commit 3d1816f

Please sign in to comment.