Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
91ff199
Add new data optimizer config to proto file
CGodiksen Jul 9, 2026
a77ab4d
Add data optimizer config to clap arguments
CGodiksen Jul 9, 2026
5847eec
Add data optimizer config to Configuration struct
CGodiksen Jul 9, 2026
9550bef
Add data optimizer config to user docs
CGodiksen Jul 9, 2026
ced2819
Fix ordering issue and run Rustfmt
CGodiksen Jul 9, 2026
32f1167
Add a data folder method to return file sizes for a table
CGodiksen Aug 5, 2026
8000036
Use data folder method to compute table sizes
CGodiksen Aug 5, 2026
410594d
Add struct for DataStorageOptimizer
CGodiksen Aug 5, 2026
2c712c2
Add try_new for DataStorageOptimizer
CGodiksen Aug 5, 2026
0ef6439
Add method to increase the estimated compactable size
CGodiksen Aug 5, 2026
3cae52c
Add method to optimize and vacuum table and use it
CGodiksen Aug 5, 2026
b01022b
Add the actual table name to the expect messages
CGodiksen Aug 5, 2026
f56f4c1
Add test util for data storage optimizer tests
CGodiksen Aug 5, 2026
d22d2cc
Add test for optimizing when size reaches target file size
CGodiksen Aug 5, 2026
3d9f76b
Add test for not opmizing when the estimate is below the target
CGodiksen Aug 5, 2026
2a8f686
Add test for catching already existing files in try_new
CGodiksen Aug 5, 2026
df94b12
Run Rustfmt
CGodiksen Aug 5, 2026
8375abb
Add data storage optimizer to compressed data manager
CGodiksen Aug 5, 2026
6a6073b
Call data storage optimizer when saving compressed data and fixed test
CGodiksen Aug 5, 2026
e0060c3
Fix clippy issue
CGodiksen Aug 5, 2026
e848105
Add methods to DataStorarageOptimizer to set configuration
CGodiksen Aug 5, 2026
5d89ae5
Add methods to StorageEngine to set configuration
CGodiksen Aug 5, 2026
94a8a4e
Add method to update optimize_target_file_size_in_bytes
CGodiksen Aug 5, 2026
2153c44
Add method to update vacuum_retention_period_in_seconds
CGodiksen Aug 5, 2026
55a63cd
Add test for setting optimize_target_file_size_in_bytes
CGodiksen Aug 5, 2026
fd822e7
Add test for rejecting 0
CGodiksen Aug 5, 2026
f54e21a
Add test for setting vacuum_retention_period_in_seconds
CGodiksen Aug 5, 2026
4870cae
Add test for setting too large vacuum_retention_period_in_seconds
CGodiksen Aug 5, 2026
3ebdc79
Add match arms to update data storage optimizer config
CGodiksen Aug 5, 2026
aba2653
Use local defaults if a target size or retention period is not specified
CGodiksen Aug 5, 2026
c00e623
Add update config tests to integration tests
CGodiksen Aug 5, 2026
bab1295
Make it clearer that the config is used as defaults
CGodiksen Aug 5, 2026
b7ba75f
Add test to WAL to ensure that optimize and vacuum does not mess with…
CGodiksen Aug 5, 2026
f88688f
Add new configs to test_can_get_configuration
CGodiksen Aug 5, 2026
bdf6c60
Add test to ensure big files are not included on startup
CGodiksen Aug 5, 2026
087cec9
Use the physical file count in data storage optimizer tests
CGodiksen Aug 6, 2026
e2dfe54
Update based on comments from @skejserjensen
CGodiksen Aug 8, 2026
600a225
Rename DataStorageOptimizer to DataStorageCompactor
CGodiksen Aug 10, 2026
6e7848a
Rename to compact in storage engine module file
CGodiksen Aug 10, 2026
1872ff3
Rename to compact in compressed data manager
CGodiksen Aug 10, 2026
97ad914
Rename compaction to merge when talking about optimize in DataFolder
CGodiksen Aug 10, 2026
2524978
Rename compaction to merge when talking about optimize in context
CGodiksen Aug 10, 2026
89f1631
Use merge instead of compaction in WAL and integration test
CGodiksen Aug 10, 2026
cdf13d8
Use merge instead of compaction when talking about optimize in embedded
CGodiksen Aug 10, 2026
70e5530
Use merge instead of compaction in bindings
CGodiksen Aug 10, 2026
c84d3b1
Use compaction instead of optimization in user docs
CGodiksen Aug 10, 2026
29a7aa5
Merge branch 'main' into dev/data-optimizer
CGodiksen Aug 10, 2026
1412623
Fix table formatting after merge
CGodiksen Aug 10, 2026
f554b47
Use compaction when describing what the new config values does
CGodiksen Aug 10, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/modelardb_embedded/bindings/c/modelardb_embedded.h
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ int modelardb_embedded_vacuum(void* maybe_operations_ptr,
const char* table_name_ptr,
const uint64_t* retention_period_in_seconds_ptr);

// Optimize the table by compacting its many small files into fewer larger files.
// Optimize the table by merging its many small files into fewer larger files.
int modelardb_embedded_optimize(void* maybe_operations_ptr,
bool is_data_folder,
const char* table_name_ptr,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ def optimize(self, table_name: str, target_size_in_bytes: None | int = None):

:param table_name: The name of the table to optimize.
:type table_name: str
:param target_size_in_bytes: The target file size in bytes. Many small files are compacted
:param target_size_in_bytes: The target file size in bytes. Many small files are merged
into fewer larger files of approximately this size. If `None`, the default target size of
64 MiB is used.
:type target_size_in_bytes: int, optional
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -512,10 +512,10 @@ def test_data_folder_optimize(self):

data_folder.optimize(TIME_SERIES_TABLE_NAME)

# Vacuum to remove the compacted files.
# Vacuum to remove the stale files left by the merge.
data_folder.vacuum(TIME_SERIES_TABLE_NAME, retention_period_in_seconds=0)

# The small files should be compacted into a single active file.
# The small files should be merged into a single active file.
file_count = len(os.listdir(folder_path))
self.assertEqual(file_count, 1)

Expand Down
2 changes: 1 addition & 1 deletion crates/modelardb_embedded/src/capi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1007,7 +1007,7 @@ unsafe fn vacuum(
}

/// Optimizes the table with the name in `table_name_ptr` in the [`DataFolder`] or [`Client`] in
/// `maybe_operations_ptr` by compacting its many small files into fewer larger files of
/// `maybe_operations_ptr` by merging its many small files into fewer larger files of
/// approximately `target_size_in_bytes_ptr` bytes. Assumes `maybe_operations_ptr` points to a
/// [`DataFolder`] or [`Client`]; `table_name_ptr` points to a valid C string; and
/// `target_size_in_bytes_ptr` points to a valid `u64`, or is null to use the default target size.
Expand Down
2 changes: 1 addition & 1 deletion crates/modelardb_embedded/src/operations/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ impl Operations for Client {
Ok(())
}

/// Optimize the table with the name in `table_name` by compacting its many small files into
/// Optimize the table with the name in `table_name` by merging its many small files into
/// fewer larger files of approximately `maybe_target_size_in_bytes` bytes. If a target size is
/// not given, the default target size of 64 MiB is used. If the table does not exist, the table
/// could not be optimized, or the target size is zero, [`ModelarDbEmbeddedError`] is returned.
Expand Down
6 changes: 3 additions & 3 deletions crates/modelardb_embedded/src/operations/data_folder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ impl Operations for DataFolder {
}
}

/// Optimize the table with the name in `table_name` by compacting its many small files into
/// Optimize the table with the name in `table_name` by merging its many small files into
/// fewer larger files of approximately `maybe_target_size_in_bytes` bytes. If a target size is
/// not given, the default target size of 64 MiB is used. If the table does not exist, the table
/// could not be optimized, or the target size is zero, [`ModelarDbEmbeddedError`] is returned.
Expand Down Expand Up @@ -2314,7 +2314,7 @@ mod tests {

data_folder.optimize(NORMAL_TABLE_NAME, None).await.unwrap();

// The small files should be compacted into a single active file.
// The small files should be merged into a single active file.
let delta_table = data_folder.delta_table(NORMAL_TABLE_NAME).await.unwrap();
assert_eq!(delta_table.get_file_uris().unwrap().count(), 1);
}
Expand Down Expand Up @@ -2343,7 +2343,7 @@ mod tests {
.await
.unwrap();

// The files in each of the two partitions should be compacted into a single active file.
// The files in each of the two partitions should be merged into a single active file.
let delta_table = data_folder
.delta_table(TIME_SERIES_TABLE_NAME)
.await
Expand Down
2 changes: 1 addition & 1 deletion crates/modelardb_embedded/src/operations/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ pub trait Operations: Sync + Send {
maybe_retention_period_in_seconds: Option<u64>,
) -> Result<()>;

/// Optimize the table with the name in `table_name` by compacting its many small files into
/// Optimize the table with the name in `table_name` by merging its many small files into
/// fewer larger files of approximately `maybe_target_size_in_bytes` bytes. If a target size is
/// not given, the default target size of 64 MiB is used.
async fn optimize(
Expand Down
Loading
Loading