summaryrefslogtreecommitdiff
path: root/internal/db
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2024-03-14 18:40:36 +0100
committerLibravatar GitHub <noreply@github.com>2024-03-14 17:40:36 +0000
commit9b94b1faa26ebca69238eadd640852c9df08f198 (patch)
tree7812a5971f1df487ba25545eb189081532a39bdb /internal/db
parent[bugfix] Don't return 500 when searching for unpermitted status (#2753) (diff)
downloadgotosocial-9b94b1faa26ebca69238eadd640852c9df08f198.tar.xz
[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 <daenney@users.noreply.github.com> --------- Co-authored-by: kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com> Co-authored-by: Daenney <daenney@users.noreply.github.com>
Diffstat (limited to 'internal/db')
-rw-r--r--internal/db/bundb/bundb.go5
1 files changed, 4 insertions, 1 deletions
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)