Skip to content

Commit 14c3210

Browse files
authored
remove analyze at startup (#452)
1 parent ff55930 commit 14c3210

File tree

1 file changed

+0
-22
lines changed

1 file changed

+0
-22
lines changed

crates/database/db/src/maintenance.rs

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -22,35 +22,13 @@ impl DatabaseMaintenance {
2222

2323
/// Runs the maintenance tasks in a loop.
2424
pub async fn run(self) {
25-
self.startup_maintenance().await;
26-
2725
loop {
2826
tokio::time::sleep(std::time::Duration::from_secs(PERIODIC_MAINTENANCE_INTERVAL_SECS))
2927
.await;
3028
self.periodic_maintenance().await;
3129
}
3230
}
3331

34-
/// Runs maintenance tasks at startup.
35-
///
36-
/// This includes running `ANALYZE` and `PRAGMA optimize`.
37-
async fn startup_maintenance(&self) {
38-
let db = self.db.inner();
39-
let conn = db.get_connection();
40-
41-
tracing::info!(target: "scroll::db::maintenance", "running startup ANALYZE...");
42-
if let Err(err) = conn.execute_unprepared("ANALYZE;").await {
43-
tracing::warn!(target: "scroll::db::maintenance", "ANALYZE failed: {:?}", err);
44-
}
45-
46-
tracing::info!(target: "scroll::db::maintenance", "running PRAGMA optimize at startup...");
47-
if let Err(err) = conn.execute_unprepared("PRAGMA optimize;").await {
48-
tracing::warn!(target: "scroll::db::maintenance", "PRAGMA optimize failed: {:?}", err);
49-
}
50-
51-
tracing::info!(target: "scroll::db::maintenance", "startup maintenance complete.");
52-
}
53-
5432
/// Runs periodic maintenance tasks.
5533
///
5634
/// This includes running `PRAGMA optimize`.

0 commit comments

Comments
 (0)