fix: improve db loads by adding index on audit

This commit is contained in:
Ruben Fiszel
2025-03-03 14:23:35 +01:00
parent 55d599d4b6
commit e1ff00117c
+7
View File
@@ -551,6 +551,7 @@ async fn v2_finalize(db: &DB) -> Result<(), Error> {
)
.await?;
});
Ok(())
}
@@ -768,6 +769,12 @@ async fn fix_job_completed_index(db: &DB) -> Result<(), Error> {
.execute(db)
.await?;
});
run_windmill_migration!("audit_timestamps", db, |tx| {
sqlx::query!("CREATE INDEX CONCURRENTLY ix_audit_timestamps ON audit (timestamp DESC)")
.execute(db)
.await?;
});
Ok(())
}