From 65861de06ef4bfb9bf7a728f1d03f92c2e8001c1 Mon Sep 17 00:00:00 2001 From: Azrenbeth <77782548+Azrenbeth@users.noreply.github.com> Date: Mon, 6 Sep 2021 10:06:47 +0100 Subject: [PATCH] Stops the compressor if it will lead to more rows in the database (#52) --- src/lib.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 053023b..a310ddd 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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 {