Stops the compressor if it will lead to more rows in the database (#52)

This commit is contained in:
Azrenbeth
2021-09-06 10:06:47 +01:00
committed by GitHub
parent 3b5d7fd176
commit 65861de06e

View File

@@ -334,6 +334,11 @@ pub fn run(mut config: Config) {
compressor.stats.state_groups_changed
);
if ratio > 1.0 {
println!("This compression would not remove any rows. Exiting.");
return;
}
if let Some(min) = config.min_saved_rows {
let saving = (original_summed_size - compressed_summed_size) as i32;
if saving < min {