db: vacuum after a db upgrade.

This is particularly useful after our recent field deletion:

before: 362,573,824 bytes
after: 124,190,720 bytes

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Changed: db: removal of old HTLC information and vacuuming shrinks large lightningd.sqlite3 by a factor of 2-3.
This commit is contained in:
Rusty Russell
2021-10-13 14:15:36 +10:30
committed by Christian Decker
parent f986549cea
commit 2bb13bacc2
4 changed files with 44 additions and 3 deletions

View File

@@ -140,7 +140,7 @@ struct db_config {
bool (*setup_fn)(struct db *db);
void (*teardown_fn)(struct db *db);
u32 (*version)(struct db *db);
bool (*vacuum_fn)(struct db *db);
};
/* Provide a way for DB backends to register themselves */