mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-07 20:38:08 -06:00
[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>
This commit is contained in:
parent
1fe4cdaf46
commit
9b94b1faa2
3 changed files with 56 additions and 1 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue