From 9b94b1faa26ebca69238eadd640852c9df08f198 Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Thu, 14 Mar 2024 18:40:36 +0100 Subject: [docs] Add database maintenance section; update info message on ANALYZE run (sqlite) (#2756) * [chore] Limit size of ANALYZE run after migration (sqlite) * add basic db maintenance tips * update docs, analyze * amend info message a wee bit * update docs/admin/database_maintenance.md wording Co-authored-by: Daenney --------- Co-authored-by: kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com> Co-authored-by: Daenney --- internal/db/bundb/bundb.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'internal/db') diff --git a/internal/db/bundb/bundb.go b/internal/db/bundb/bundb.go index a07cd6142..b0ce575e6 100644 --- a/internal/db/bundb/bundb.go +++ b/internal/db/bundb/bundb.go @@ -112,7 +112,10 @@ func doMigration(ctx context.Context, db *bun.DB) error { log.Infof(ctx, "MIGRATED DATABASE TO %s", group) if db.Dialect().Name() == dialect.SQLite { - log.Info(ctx, "running ANALYZE to update table and index statistics") + log.Info(ctx, + "running ANALYZE to update table and index statistics; this will take somewhere between "+ + "1-10 minutes, or maybe longer depending on your hardware and database size, please be patient", + ) _, err := db.ExecContext(ctx, "ANALYZE") if err != nil { log.Warnf(ctx, "ANALYZE failed, query planner may make poor life choices: %s", err) -- cgit v1.3