From f631f43024632845d384229408da4d19dfceec80 Mon Sep 17 00:00:00 2001 From: dullbananas Date: Wed, 7 Feb 2024 20:37:44 -0700 Subject: [PATCH] Run analyze in db_perf (#4420) --- crates/db_perf/src/main.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/db_perf/src/main.rs b/crates/db_perf/src/main.rs index 60bd30c82..2da9f9574 100644 --- a/crates/db_perf/src/main.rs +++ b/crates/db_perf/src/main.rs @@ -130,6 +130,10 @@ async fn try_main() -> LemmyResult<()> { // Make sure the println above shows the correct amount assert_eq!(num_inserted_posts, num_posts as usize); + // Manually trigger and wait for a statistics update to ensure consistent and high amount of accuracy in the statistics used for query planning + println!("🧮 updating database statistics"); + conn.batch_execute("ANALYZE;").await?; + // Enable auto_explain conn .batch_execute(