mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 14:40:12 +01:00
🎨 Manually optimize the data index to reduce space usage and improve performance https://github.com/siyuan-note/siyuan/issues/15663
This commit is contained in:
parent
8895613f8b
commit
34360fb9e3
15 changed files with 98 additions and 14 deletions
|
|
@ -1533,3 +1533,22 @@ func SQLTemplateFuncs(templateFuncMap *template.FuncMap) {
|
|||
return
|
||||
}
|
||||
}
|
||||
|
||||
func Vacuum() {
|
||||
if nil != db {
|
||||
if _, err := db.Exec("VACUUM"); nil != err {
|
||||
logging.LogErrorf("vacuum database failed: %s", err)
|
||||
}
|
||||
}
|
||||
if nil != historyDB {
|
||||
if _, err := historyDB.Exec("VACUUM"); nil != err {
|
||||
logging.LogErrorf("vacuum history database failed: %s", err)
|
||||
}
|
||||
}
|
||||
if nil != assetContentDB {
|
||||
if _, err := assetContentDB.Exec("VACUUM"); nil != err {
|
||||
logging.LogErrorf("vacuum asset content database failed: %s", err)
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue