Skip to content

Commit 65861de

Browse files
authored
Stops the compressor if it will lead to more rows in the database (#52)
1 parent 3b5d7fd commit 65861de

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,11 @@ pub fn run(mut config: Config) {
334334
compressor.stats.state_groups_changed
335335
);
336336

337+
if ratio > 1.0 {
338+
println!("This compression would not remove any rows. Exiting.");
339+
return;
340+
}
341+
337342
if let Some(min) = config.min_saved_rows {
338343
let saving = (original_summed_size - compressed_summed_size) as i32;
339344
if saving < min {

0 commit comments

Comments
 (0)