Stops the compressor if it will lead to more rows in the database (#52)
This commit is contained in:
@@ -334,6 +334,11 @@ pub fn run(mut config: Config) {
|
|||||||
compressor.stats.state_groups_changed
|
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 {
|
if let Some(min) = config.min_saved_rows {
|
||||||
let saving = (original_summed_size - compressed_summed_size) as i32;
|
let saving = (original_summed_size - compressed_summed_size) as i32;
|
||||||
if saving < min {
|
if saving < min {
|
||||||
|
|||||||
Reference in New Issue
Block a user