${window.siyuan.languages.systemLog}
From 1f3c3a53b4cf9f21ed30a417e147bedf83511c61 Mon Sep 17 00:00:00 2001
From: Daniel <845765@qq.com>
Date: Sun, 24 Aug 2025 15:44:17 +0800
Subject: [PATCH 03/14] :art: Manually optimize the data index to reduce space
usage and improve performance
https://github.com/siyuan-note/siyuan/issues/15663
---
app/src/config/about.ts | 6 ++++++
app/src/mobile/settings/about.ts | 10 ++++++++++
2 files changed, 16 insertions(+)
diff --git a/app/src/config/about.ts b/app/src/config/about.ts
index c9ab2aa17..99a26df45 100644
--- a/app/src/config/about.ts
+++ b/app/src/config/about.ts
@@ -254,6 +254,12 @@ ${checkUpdateHTML}
about.element.querySelector("#tokenTip").innerHTML = window.siyuan.languages.about14.replace("${token}", window.siyuan.config.api.token);
});
});
+ about.element.querySelector("#vacuumDataIndex").addEventListener("click", () => {
+ fetchPost("/api/system/vacuumDataIndex", {}, (response) => {});
+ });
+ about.element.querySelector("#rebuildDataIndex").addEventListener("click", () => {
+ fetchPost("/api/system/rebuildDataIndex", {}, (response) => {});
+ });
about.element.querySelector("#exportLog").addEventListener("click", () => {
fetchPost("/api/system/exportLog", {}, (response) => {
openByMobile(response.data.zip);
diff --git a/app/src/mobile/settings/about.ts b/app/src/mobile/settings/about.ts
index 46f445b93..592a34ca8 100644
--- a/app/src/mobile/settings/about.ts
+++ b/app/src/mobile/settings/about.ts
@@ -299,6 +299,16 @@ export const initAbout = () => {
event.preventDefault();
event.stopPropagation();
break;
+ } else if (target.id === "vacuumDataIndex") {
+ fetchPost("/api/system/vacuumDataIndex", {}, (response) => {});
+ event.preventDefault();
+ event.stopPropagation();
+ break;
+ } else if (target.id === "exportLog") {
+ fetchPost("/api/system/rebuildDataIndex", {}, (response) => {});
+ event.preventDefault();
+ event.stopPropagation();
+ break;
} else if (target.id === "exportLog") {
fetchPost("/api/system/exportLog", {}, (response) => {
openByMobile(response.data.zip);
From 7e6752a8fbbdfb184f448d7dd65ac996d79116bf Mon Sep 17 00:00:00 2001
From: Daniel <845765@qq.com>
Date: Sun, 24 Aug 2025 15:48:22 +0800
Subject: [PATCH 04/14] :art: Manually optimize the data index to reduce space
usage and improve performance
https://github.com/siyuan-note/siyuan/issues/15663
---
kernel/api/router.go | 2 ++
kernel/api/system.go | 14 ++++++++++++++
kernel/model/box.go | 4 ++++
3 files changed, 20 insertions(+)
diff --git a/kernel/api/router.go b/kernel/api/router.go
index c7a7d37da..60ef85547 100644
--- a/kernel/api/router.go
+++ b/kernel/api/router.go
@@ -67,6 +67,8 @@ func ServeAPI(ginServer *gin.Engine) {
ginServer.Handle("POST", "/api/system/reloadUI", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, reloadUI) // TODO 请使用 /api/ui/reloadUI,该端点计划于 2026 年 6 月 30 日后删除 https://github.com/siyuan-note/siyuan/issues/15308#issuecomment-3077675356
ginServer.Handle("POST", "/api/system/addMicrosoftDefenderExclusion", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, addMicrosoftDefenderExclusion)
ginServer.Handle("POST", "/api/system/ignoreAddMicrosoftDefenderExclusion", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, ignoreAddMicrosoftDefenderExclusion)
+ ginServer.Handle("POST", "/api/system/vacuumDataIndex", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, vacuumDataIndex)
+ ginServer.Handle("POST", "/api/system/rebuildDataIndex", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, rebuildDataIndex)
ginServer.Handle("POST", "/api/storage/setLocalStorage", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, setLocalStorage)
ginServer.Handle("POST", "/api/storage/getLocalStorage", model.CheckAuth, getLocalStorage)
diff --git a/kernel/api/system.go b/kernel/api/system.go
index 71cade88a..641bbef75 100644
--- a/kernel/api/system.go
+++ b/kernel/api/system.go
@@ -35,6 +35,20 @@ import (
"github.com/siyuan-note/siyuan/kernel/util"
)
+func vacuumDataIndex(c *gin.Context) {
+ ret := gulu.Ret.NewResult()
+ defer c.JSON(http.StatusOK, ret)
+
+ model.VacuumDataIndex()
+}
+
+func rebuildDataIndex(c *gin.Context) {
+ ret := gulu.Ret.NewResult()
+ defer c.JSON(http.StatusOK, ret)
+
+ model.FullReindex()
+}
+
func addMicrosoftDefenderExclusion(c *gin.Context) {
ret := gulu.Ret.NewResult()
defer c.JSON(http.StatusOK, ret)
diff --git a/kernel/model/box.go b/kernel/model/box.go
index 2ad64abe9..aae8667e2 100644
--- a/kernel/model/box.go
+++ b/kernel/model/box.go
@@ -663,6 +663,10 @@ func normalizeTree(tree *parse.Tree) (yfmRootID, yfmTitle, yfmUpdated string) {
return
}
+func VacuumDataIndex() {
+
+}
+
func FullReindex() {
task.AppendTask(task.DatabaseIndexFull, fullReindex)
task.AppendTask(task.DatabaseIndexRef, IndexRefs)
From d0f350d2159a26a195e03fa02d148db2932d0bd2 Mon Sep 17 00:00:00 2001
From: Daniel <845765@qq.com>
Date: Mon, 25 Aug 2025 10:43:50 +0800
Subject: [PATCH 05/14] :art:
https://github.com/siyuan-note/siyuan/issues/15669
---
app/appearance/langs/ar_SA.json | 3 ++-
app/appearance/langs/de_DE.json | 3 ++-
app/appearance/langs/en_US.json | 3 ++-
app/appearance/langs/es_ES.json | 3 ++-
app/appearance/langs/fr_FR.json | 3 ++-
app/appearance/langs/he_IL.json | 3 ++-
app/appearance/langs/it_IT.json | 3 ++-
app/appearance/langs/ja_JP.json | 3 ++-
app/appearance/langs/pl_PL.json | 3 ++-
app/appearance/langs/pt_BR.json | 3 ++-
app/appearance/langs/ru_RU.json | 3 ++-
app/appearance/langs/zh_CHT.json | 3 ++-
app/appearance/langs/zh_CN.json | 3 ++-
kernel/api/av.go | 2 +-
kernel/model/attribute_view.go | 15 +++++++++++----
kernel/model/file.go | 2 +-
kernel/model/transaction.go | 4 ++--
17 files changed, 41 insertions(+), 21 deletions(-)
diff --git a/app/appearance/langs/ar_SA.json b/app/appearance/langs/ar_SA.json
index 05215c239..5244a929f 100644
--- a/app/appearance/langs/ar_SA.json
+++ b/app/appearance/langs/ar_SA.json
@@ -1653,6 +1653,7 @@
"265": "خارج النطاق",
"266": "Tesseract OCR غير مثبت أو غير مهيأ، يرجى الرجوع إلى دليل المستخدم - قسم ملفات الموارد لإجراء الإعداد",
"267": "قاعدة بيانات غير مسماة",
- "268": "يرجى ملاحظة أن الملف [%s] قد تجاوز بالفعل [%d MB]، وقد يؤدي ذلك إلى انخفاض الأداء"
+ "268": "يرجى ملاحظة أن الملف [%s] قد تجاوز بالفعل [%d MB]، وقد يؤدي ذلك إلى انخفاض الأداء",
+ "269": "تمت إضافة هذا المقطع بالفعل إلى قاعدة البيانات [%s]"
}
}
diff --git a/app/appearance/langs/de_DE.json b/app/appearance/langs/de_DE.json
index 940c6b105..f7531aa69 100644
--- a/app/appearance/langs/de_DE.json
+++ b/app/appearance/langs/de_DE.json
@@ -1653,6 +1653,7 @@
"265": "Außerhalb des Bereichs",
"266": "Tesseract OCR ist nicht installiert oder konfiguriert, bitte lesen Sie das Benutzerhandbuch - Abschnitt Ressourcen-Dateien zur Konfiguration",
"267": "Unbenannte Datenbank",
- "268": "Bitte beachten Sie, dass die Datei [%s] bereits [%d MB] überschritten hat, was die Leistung beeinträchtigen kann"
+ "268": "Bitte beachten Sie, dass die Datei [%s] bereits [%d MB] überschritten hat, was die Leistung beeinträchtigen kann",
+ "269": "Dieser Block wurde bereits zur Datenbank [%s] hinzugefügt"
}
}
diff --git a/app/appearance/langs/en_US.json b/app/appearance/langs/en_US.json
index 2a41c4d64..37a1349be 100644
--- a/app/appearance/langs/en_US.json
+++ b/app/appearance/langs/en_US.json
@@ -1653,6 +1653,7 @@
"265": "Out of range",
"266": "Tesseract OCR is not installed or configured, please refer to the User Guide - Assets section for configuration",
"267": "Unnamed database",
- "268": "Please note that the file [%s] has already exceeded [%d MB], which may cause performance degradation"
+ "268": "Please note that the file [%s] has already exceeded [%d MB], which may cause performance degradation",
+ "269": "This block has already been added to the database [%s]"
}
}
diff --git a/app/appearance/langs/es_ES.json b/app/appearance/langs/es_ES.json
index 22a5186b3..4ce5df0a8 100644
--- a/app/appearance/langs/es_ES.json
+++ b/app/appearance/langs/es_ES.json
@@ -1653,6 +1653,7 @@
"265": "Fuera de rango",
"266": "Tesseract OCR no está instalado o configurado, consulte la Guía del Usuario - Sección de archivos de recursos para la configuración",
"267": "Base de datos sin nombre",
- "268": "Atención: el archivo [%s] ya ha superado los [%d MB], lo que puede causar una disminución del rendimiento"
+ "268": "Atención: el archivo [%s] ya ha superado los [%d MB], lo que puede causar una disminución del rendimiento",
+ "269": "Este bloque ya ha sido añadido a la base de datos [%s]"
}
}
diff --git a/app/appearance/langs/fr_FR.json b/app/appearance/langs/fr_FR.json
index ef22674ca..cabcf5c1f 100644
--- a/app/appearance/langs/fr_FR.json
+++ b/app/appearance/langs/fr_FR.json
@@ -1653,6 +1653,7 @@
"265": "Hors de portée",
"266": "Tesseract OCR n'est pas installé ou configuré, veuillez consulter le Guide de l'utilisateur - Section des fichiers de ressources pour la configuration",
"267": "Base de données sans nom",
- "268": "Attention : le fichier [%s] a déjà dépassé [%d MB], ce qui peut entraîner une baisse des performances"
+ "268": "Attention : le fichier [%s] a déjà dépassé [%d MB], ce qui peut entraîner une baisse des performances",
+ "269": "Ce bloc a déjà été ajouté à la base de données [%s]"
}
}
diff --git a/app/appearance/langs/he_IL.json b/app/appearance/langs/he_IL.json
index 3a6088fd4..338c5daa5 100644
--- a/app/appearance/langs/he_IL.json
+++ b/app/appearance/langs/he_IL.json
@@ -1653,6 +1653,7 @@
"265": "מחוץ לטווח",
"266": "Tesseract OCR לא הותקן או הוגדר, אנא עיין במדריך למשתמש - פרק קבצי משאבים לצורך הגדרה",
"267": "מסד נתונים ללא שם",
- "268": "שים לב שהקובץ [%s] כבר חרג מ-[%d MB], דבר שעלול לגרום לירידה בביצועים"
+ "268": "שים לב שהקובץ [%s] כבר חרג מ-[%d MB], דבר שעלול לגרום לירידה בביצועים",
+ "269": "הבלוק נוסף כבר למסד הנתונים [%s]"
}
}
diff --git a/app/appearance/langs/it_IT.json b/app/appearance/langs/it_IT.json
index 0b63b2690..12971630e 100644
--- a/app/appearance/langs/it_IT.json
+++ b/app/appearance/langs/it_IT.json
@@ -1653,6 +1653,7 @@
"265": "Fuori intervallo",
"266": "Tesseract OCR non è installato o configurato, fare riferimento alla Guida utente - Sezione file di risorse per la configurazione",
"267": "Database senza nome",
- "268": "Attenzione: il file [%s] ha già superato [%d MB], il che potrebbe causare un calo delle prestazioni"
+ "268": "Attenzione: il file [%s] ha già superato [%d MB], il che potrebbe causare un calo delle prestazioni",
+ "269": "Questo blocco è già stato aggiunto al database [%s]"
}
}
diff --git a/app/appearance/langs/ja_JP.json b/app/appearance/langs/ja_JP.json
index 84d35407e..4592526f5 100644
--- a/app/appearance/langs/ja_JP.json
+++ b/app/appearance/langs/ja_JP.json
@@ -1653,6 +1653,7 @@
"265": "範囲外",
"266": "Tesseract OCR がインストールされていないか、設定されていません。ユーザーガイド - リソースファイルセクションを参照して設定してください",
"267": "未命名のデータベース",
- "268": "ファイル [%s] はすでに [%d MB] を超えており、パフォーマンスが低下する可能性があります"
+ "268": "ファイル [%s] はすでに [%d MB] を超えており、パフォーマンスが低下する可能性があります",
+ "269": "このブロックはすでにデータベース [%s] に追加されています"
}
}
diff --git a/app/appearance/langs/pl_PL.json b/app/appearance/langs/pl_PL.json
index 0d2972d1c..58d87f85b 100644
--- a/app/appearance/langs/pl_PL.json
+++ b/app/appearance/langs/pl_PL.json
@@ -1653,6 +1653,7 @@
"265": "Poza zakresem",
"266": "Tesseract OCR nie jest zainstalowany lub skonfigurowany, zapoznaj się z Podręcznikiem użytkownika - Sekcja plików zasobów, aby skonfigurować",
"267": "Nienazwana baza danych",
- "268": "Uwaga: plik [%s] przekroczył już [%d MB], co może spowodować spadek wydajności"
+ "268": "Uwaga: plik [%s] przekroczył już [%d MB], co może spowodować spadek wydajności",
+ "269": "Ten blok został już dodany do bazy danych [%s]"
}
}
diff --git a/app/appearance/langs/pt_BR.json b/app/appearance/langs/pt_BR.json
index c484274e6..f138a36ef 100644
--- a/app/appearance/langs/pt_BR.json
+++ b/app/appearance/langs/pt_BR.json
@@ -1653,6 +1653,7 @@
"265": "Fora do intervalo",
"266": "Tesseract OCR não está instalado ou configurado, consulte o Guia do Usuário - Seção de Arquivos de Recursos para configuração",
"267": "Banco de dados sem nome",
- "268": "Atenção: o arquivo [%s] já excedeu [%d MB], o que pode causar queda de desempenho"
+ "268": "Atenção: o arquivo [%s] já excedeu [%d MB], o que pode causar queda de desempenho",
+ "269": "Este bloco já foi adicionado ao banco de dados [%s]"
}
}
diff --git a/app/appearance/langs/ru_RU.json b/app/appearance/langs/ru_RU.json
index 6930c7955..9ad43b3b7 100644
--- a/app/appearance/langs/ru_RU.json
+++ b/app/appearance/langs/ru_RU.json
@@ -1653,6 +1653,7 @@
"265": "Вне диапазона",
"266": "Tesseract OCR не установлен или не настроен, пожалуйста, обратитесь к Руководству пользователя - Раздел ресурсов для настройки",
"267": "База данных не названа",
- "268": "Обратите внимание, что файл [%s] уже превышает [%d МБ], это может привести к снижению производительности"
+ "268": "Обратите внимание, что файл [%s] уже превышает [%d МБ], это может привести к снижению производительности",
+ "269": "Этот блок уже добавлен в базу данных [%s]"
}
}
diff --git a/app/appearance/langs/zh_CHT.json b/app/appearance/langs/zh_CHT.json
index d6f3f97e7..008bc1af5 100644
--- a/app/appearance/langs/zh_CHT.json
+++ b/app/appearance/langs/zh_CHT.json
@@ -1653,6 +1653,7 @@
"265": "不在範圍內",
"266": "Tesseract OCR 未安裝或未配置,請參考 用戶指南-資料文件 章節進行配置",
"267": "未命名資料庫",
- "268": "請注意該檔案 [%s] 已經超過 [%d MB],可能會導致效能下降"
+ "268": "請注意該檔案 [%s] 已經超過 [%d MB],可能會導致效能下降",
+ "269": "該塊已經添加到資料庫 [%s] 中"
}
}
diff --git a/app/appearance/langs/zh_CN.json b/app/appearance/langs/zh_CN.json
index de820395e..5d02ce44c 100644
--- a/app/appearance/langs/zh_CN.json
+++ b/app/appearance/langs/zh_CN.json
@@ -1653,6 +1653,7 @@
"265": "不在范围内",
"266": "Tesseract OCR 未安装或未配置,请参考 用户指南-资源文件 章节进行配置",
"267": "未命名数据库",
- "268": "请注意该文件 [%s] 已经超过 [%d MB],可能会导致性能下降"
+ "268": "请注意该文件 [%s] 已经超过 [%d MB],可能会导致性能下降",
+ "269": "该块已经添加到数据库 [%s] 中"
}
}
diff --git a/kernel/api/av.go b/kernel/api/av.go
index a242f0b65..43553c19f 100644
--- a/kernel/api/av.go
+++ b/kernel/api/av.go
@@ -351,7 +351,7 @@ func addAttributeViewBlocks(c *gin.Context) {
ignoreDefaultFill = arg["ignoreDefaultFill"].(bool)
}
- err := model.AddAttributeViewBlock(nil, srcs, avID, blockID, groupID, previousID, ignoreDefaultFill)
+ err := model.AddAttributeViewBlock(nil, srcs, avID, blockID, groupID, previousID, ignoreDefaultFill, nil)
if err != nil {
ret.Code = -1
ret.Msg = err.Error()
diff --git a/kernel/model/attribute_view.go b/kernel/model/attribute_view.go
index 0bfec558d..b50ae0b31 100644
--- a/kernel/model/attribute_view.go
+++ b/kernel/model/attribute_view.go
@@ -2958,14 +2958,14 @@ func setAttributeViewColumnCalc(operation *Operation) (err error) {
}
func (tx *Transaction) doInsertAttrViewBlock(operation *Operation) (ret *TxErr) {
- err := AddAttributeViewBlock(tx, operation.Srcs, operation.AvID, operation.BlockID, operation.GroupID, operation.PreviousID, operation.IgnoreDefaultFill)
+ err := AddAttributeViewBlock(tx, operation.Srcs, operation.AvID, operation.BlockID, operation.GroupID, operation.PreviousID, operation.IgnoreDefaultFill, operation.Context)
if err != nil {
return &TxErr{code: TxErrHandleAttributeView, id: operation.AvID, msg: err.Error()}
}
return
}
-func AddAttributeViewBlock(tx *Transaction, srcs []map[string]interface{}, avID, dbBlockID, groupID, previousItemID string, ignoreDefaultFill bool) (err error) {
+func AddAttributeViewBlock(tx *Transaction, srcs []map[string]interface{}, avID, dbBlockID, groupID, previousItemID string, ignoreDefaultFill bool, context map[string]interface{}) (err error) {
slices.Reverse(srcs) // https://github.com/siyuan-note/siyuan/issues/11286
now := time.Now().UnixMilli()
@@ -3000,14 +3000,18 @@ func AddAttributeViewBlock(tx *Transaction, srcs []map[string]interface{}, avID,
if nil != src["content"] {
srcContent = src["content"].(string)
}
- if avErr := addAttributeViewBlock(now, avID, dbBlockID, groupID, previousItemID, srcItemID, boundBlockID, srcContent, isDetached, ignoreDefaultFill, tree, tx); nil != avErr {
+ if avErr := addAttributeViewBlock(now, avID, dbBlockID, groupID, previousItemID, srcItemID, boundBlockID, srcContent, isDetached, ignoreDefaultFill, tree, tx, context); nil != avErr {
return avErr
}
}
return
}
-func addAttributeViewBlock(now int64, avID, dbBlockID, groupID, previousItemID, addingItemID, addingBoundBlockID, addingBlockContent string, isDetached, ignoreDefaultFill bool, tree *parse.Tree, tx *Transaction) (err error) {
+func addAttributeViewBlock(now int64, avID, dbBlockID, groupID, previousItemID, addingItemID, addingBoundBlockID, addingBlockContent string, isDetached, ignoreDefaultFill bool, tree *parse.Tree, tx *Transaction, context map[string]interface{}) (err error) {
+ if nil == context {
+ context = map[string]any{}
+ }
+
var node *ast.Node
if !isDetached {
node = treenode.GetNodeInTree(tree, addingBoundBlockID)
@@ -3051,6 +3055,9 @@ func addAttributeViewBlock(now int64, avID, dbBlockID, groupID, previousItemID,
blockValue.UpdatedAt = now
err = av.SaveAttributeView(attrView)
}
+
+ msg := fmt.Sprintf(Conf.language(269), attrView.Name)
+ context["message"] = msg
return
}
}
diff --git a/kernel/model/file.go b/kernel/model/file.go
index aa723d809..d5331504c 100644
--- a/kernel/model/file.go
+++ b/kernel/model/file.go
@@ -991,7 +991,7 @@ func DuplicateDoc(tree *parse.Tree) {
AddAttributeViewBlock(nil, []map[string]interface{}{{
"id": n.ID,
"isDetached": false,
- }}, avID, "", "", "", false)
+ }}, avID, "", "", "", false, nil)
ReloadAttrView(avID)
}
return ast.WalkContinue
diff --git a/kernel/model/transaction.go b/kernel/model/transaction.go
index 898591a86..61d161244 100644
--- a/kernel/model/transaction.go
+++ b/kernel/model/transaction.go
@@ -1099,7 +1099,7 @@ func (tx *Transaction) doLargeInsert(previousID string) (ret *TxErr) {
AddAttributeViewBlock(tx, []map[string]interface{}{{
"id": insertedNode.ID,
"isDetached": false,
- }}, avID, "", "", previousID, false)
+ }}, avID, "", "", previousID, false, nil)
ReloadAttrView(avID)
}
@@ -1284,7 +1284,7 @@ func (tx *Transaction) doInsert(operation *Operation) (ret *TxErr) {
AddAttributeViewBlock(tx, []map[string]interface{}{{
"id": insertedNode.ID,
"isDetached": false,
- }}, avID, "", "", previousID, false)
+ }}, avID, "", "", previousID, false, nil)
ReloadAttrView(avID)
}
From 8895613f8bc230109d6bb887b7c063e855a4dd8f Mon Sep 17 00:00:00 2001
From: Daniel <845765@qq.com>
Date: Mon, 25 Aug 2025 10:58:45 +0800
Subject: [PATCH 06/14] :art:
https://github.com/siyuan-note/siyuan/issues/15669
---
kernel/api/av.go | 2 +-
kernel/model/attribute_view.go | 8 ++++----
kernel/model/file.go | 2 +-
kernel/model/transaction.go | 4 ++--
4 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/kernel/api/av.go b/kernel/api/av.go
index 43553c19f..63050ecf3 100644
--- a/kernel/api/av.go
+++ b/kernel/api/av.go
@@ -351,7 +351,7 @@ func addAttributeViewBlocks(c *gin.Context) {
ignoreDefaultFill = arg["ignoreDefaultFill"].(bool)
}
- err := model.AddAttributeViewBlock(nil, srcs, avID, blockID, groupID, previousID, ignoreDefaultFill, nil)
+ err := model.AddAttributeViewBlock(nil, srcs, avID, blockID, groupID, previousID, ignoreDefaultFill, map[string]interface{}{})
if err != nil {
ret.Code = -1
ret.Msg = err.Error()
diff --git a/kernel/model/attribute_view.go b/kernel/model/attribute_view.go
index b50ae0b31..7c9673e23 100644
--- a/kernel/model/attribute_view.go
+++ b/kernel/model/attribute_view.go
@@ -2958,6 +2958,10 @@ func setAttributeViewColumnCalc(operation *Operation) (err error) {
}
func (tx *Transaction) doInsertAttrViewBlock(operation *Operation) (ret *TxErr) {
+ if nil == operation.Context {
+ operation.Context = map[string]interface{}{}
+ }
+
err := AddAttributeViewBlock(tx, operation.Srcs, operation.AvID, operation.BlockID, operation.GroupID, operation.PreviousID, operation.IgnoreDefaultFill, operation.Context)
if err != nil {
return &TxErr{code: TxErrHandleAttributeView, id: operation.AvID, msg: err.Error()}
@@ -3008,10 +3012,6 @@ func AddAttributeViewBlock(tx *Transaction, srcs []map[string]interface{}, avID,
}
func addAttributeViewBlock(now int64, avID, dbBlockID, groupID, previousItemID, addingItemID, addingBoundBlockID, addingBlockContent string, isDetached, ignoreDefaultFill bool, tree *parse.Tree, tx *Transaction, context map[string]interface{}) (err error) {
- if nil == context {
- context = map[string]any{}
- }
-
var node *ast.Node
if !isDetached {
node = treenode.GetNodeInTree(tree, addingBoundBlockID)
diff --git a/kernel/model/file.go b/kernel/model/file.go
index d5331504c..cf429baf8 100644
--- a/kernel/model/file.go
+++ b/kernel/model/file.go
@@ -991,7 +991,7 @@ func DuplicateDoc(tree *parse.Tree) {
AddAttributeViewBlock(nil, []map[string]interface{}{{
"id": n.ID,
"isDetached": false,
- }}, avID, "", "", "", false, nil)
+ }}, avID, "", "", "", false, map[string]interface{}{})
ReloadAttrView(avID)
}
return ast.WalkContinue
diff --git a/kernel/model/transaction.go b/kernel/model/transaction.go
index 61d161244..04bcf13ef 100644
--- a/kernel/model/transaction.go
+++ b/kernel/model/transaction.go
@@ -1099,7 +1099,7 @@ func (tx *Transaction) doLargeInsert(previousID string) (ret *TxErr) {
AddAttributeViewBlock(tx, []map[string]interface{}{{
"id": insertedNode.ID,
"isDetached": false,
- }}, avID, "", "", previousID, false, nil)
+ }}, avID, "", "", previousID, false, map[string]interface{}{})
ReloadAttrView(avID)
}
@@ -1284,7 +1284,7 @@ func (tx *Transaction) doInsert(operation *Operation) (ret *TxErr) {
AddAttributeViewBlock(tx, []map[string]interface{}{{
"id": insertedNode.ID,
"isDetached": false,
- }}, avID, "", "", previousID, false, nil)
+ }}, avID, "", "", previousID, false, map[string]interface{}{})
ReloadAttrView(avID)
}
From 34360fb9e37725853faa67070613fb1496c9f3db Mon Sep 17 00:00:00 2001
From: Daniel <845765@qq.com>
Date: Mon, 25 Aug 2025 11:23:42 +0800
Subject: [PATCH 07/14] :art: Manually optimize the data index to reduce space
usage and improve performance
https://github.com/siyuan-note/siyuan/issues/15663
---
app/appearance/langs/ar_SA.json | 4 +++-
app/appearance/langs/de_DE.json | 4 +++-
app/appearance/langs/en_US.json | 4 +++-
app/appearance/langs/es_ES.json | 4 +++-
app/appearance/langs/fr_FR.json | 4 +++-
app/appearance/langs/he_IL.json | 4 +++-
app/appearance/langs/it_IT.json | 4 +++-
app/appearance/langs/ja_JP.json | 4 +++-
app/appearance/langs/pl_PL.json | 4 +++-
app/appearance/langs/pt_BR.json | 4 +++-
app/appearance/langs/ru_RU.json | 4 +++-
app/appearance/langs/zh_CHT.json | 4 +++-
app/appearance/langs/zh_CN.json | 4 +++-
kernel/model/box.go | 41 +++++++++++++++++++++++++++++++-
kernel/sql/database.go | 19 +++++++++++++++
15 files changed, 98 insertions(+), 14 deletions(-)
diff --git a/app/appearance/langs/ar_SA.json b/app/appearance/langs/ar_SA.json
index 5244a929f..bff8745aa 100644
--- a/app/appearance/langs/ar_SA.json
+++ b/app/appearance/langs/ar_SA.json
@@ -1654,6 +1654,8 @@
"266": "Tesseract OCR غير مثبت أو غير مهيأ، يرجى الرجوع إلى دليل المستخدم - قسم ملفات الموارد لإجراء الإعداد",
"267": "قاعدة بيانات غير مسماة",
"268": "يرجى ملاحظة أن الملف [%s] قد تجاوز بالفعل [%d MB]، وقد يؤدي ذلك إلى انخفاض الأداء",
- "269": "تمت إضافة هذا المقطع بالفعل إلى قاعدة البيانات [%s]"
+ "269": "تمت إضافة هذا المقطع بالفعل إلى قاعدة البيانات [%s]",
+ "270": "يتم تحسين فهرس البيانات، يرجى الانتظار...",
+ "271": "اكتملت عملية تحسين فهرس البيانات، تم تحرير [%s] من مساحة القرص"
}
}
diff --git a/app/appearance/langs/de_DE.json b/app/appearance/langs/de_DE.json
index f7531aa69..9e429c0c3 100644
--- a/app/appearance/langs/de_DE.json
+++ b/app/appearance/langs/de_DE.json
@@ -1654,6 +1654,8 @@
"266": "Tesseract OCR ist nicht installiert oder konfiguriert, bitte lesen Sie das Benutzerhandbuch - Abschnitt Ressourcen-Dateien zur Konfiguration",
"267": "Unbenannte Datenbank",
"268": "Bitte beachten Sie, dass die Datei [%s] bereits [%d MB] überschritten hat, was die Leistung beeinträchtigen kann",
- "269": "Dieser Block wurde bereits zur Datenbank [%s] hinzugefügt"
+ "269": "Dieser Block wurde bereits zur Datenbank [%s] hinzugefügt",
+ "270": "Datenindex wird optimiert, bitte warten...",
+ "271": "Datenindex-Optimierung abgeschlossen, [%s] Speicherplatz freigegeben"
}
}
diff --git a/app/appearance/langs/en_US.json b/app/appearance/langs/en_US.json
index 37a1349be..817af3caf 100644
--- a/app/appearance/langs/en_US.json
+++ b/app/appearance/langs/en_US.json
@@ -1654,6 +1654,8 @@
"266": "Tesseract OCR is not installed or configured, please refer to the User Guide - Assets section for configuration",
"267": "Unnamed database",
"268": "Please note that the file [%s] has already exceeded [%d MB], which may cause performance degradation",
- "269": "This block has already been added to the database [%s]"
+ "269": "This block has already been added to the database [%s]",
+ "270": "Optimizing data index, please wait...",
+ "271": "Data index optimization completed, [%s] disk space freed"
}
}
diff --git a/app/appearance/langs/es_ES.json b/app/appearance/langs/es_ES.json
index 4ce5df0a8..b939ef1df 100644
--- a/app/appearance/langs/es_ES.json
+++ b/app/appearance/langs/es_ES.json
@@ -1654,6 +1654,8 @@
"266": "Tesseract OCR no está instalado o configurado, consulte la Guía del Usuario - Sección de archivos de recursos para la configuración",
"267": "Base de datos sin nombre",
"268": "Atención: el archivo [%s] ya ha superado los [%d MB], lo que puede causar una disminución del rendimiento",
- "269": "Este bloque ya ha sido añadido a la base de datos [%s]"
+ "269": "Este bloque ya ha sido añadido a la base de datos [%s]",
+ "270": "Optimizando el índice de datos, por favor espere...",
+ "271": "Optimización del índice de datos completada, se liberaron [%s] de espacio en disco"
}
}
diff --git a/app/appearance/langs/fr_FR.json b/app/appearance/langs/fr_FR.json
index cabcf5c1f..5c4888275 100644
--- a/app/appearance/langs/fr_FR.json
+++ b/app/appearance/langs/fr_FR.json
@@ -1654,6 +1654,8 @@
"266": "Tesseract OCR n'est pas installé ou configuré, veuillez consulter le Guide de l'utilisateur - Section des fichiers de ressources pour la configuration",
"267": "Base de données sans nom",
"268": "Attention : le fichier [%s] a déjà dépassé [%d MB], ce qui peut entraîner une baisse des performances",
- "269": "Ce bloc a déjà été ajouté à la base de données [%s]"
+ "269": "Ce bloc a déjà été ajouté à la base de données [%s]",
+ "270": "Optimisation de l’index des données en cours, veuillez patienter...",
+ "271": "Optimisation de l’index des données terminée, [%s] d’espace disque libéré"
}
}
diff --git a/app/appearance/langs/he_IL.json b/app/appearance/langs/he_IL.json
index 338c5daa5..1222be647 100644
--- a/app/appearance/langs/he_IL.json
+++ b/app/appearance/langs/he_IL.json
@@ -1654,6 +1654,8 @@
"266": "Tesseract OCR לא הותקן או הוגדר, אנא עיין במדריך למשתמש - פרק קבצי משאבים לצורך הגדרה",
"267": "מסד נתונים ללא שם",
"268": "שים לב שהקובץ [%s] כבר חרג מ-[%d MB], דבר שעלול לגרום לירידה בביצועים",
- "269": "הבלוק נוסף כבר למסד הנתונים [%s]"
+ "269": "הבלוק נוסף כבר למסד הנתונים [%s]",
+ "270": "מתבצעת אופטימיזציה של אינדקס הנתונים, נא להמתין...",
+ "271": "אופטימיזציית אינדקס הנתונים הושלמה, שוחררו [%s] שטח דיסק"
}
}
diff --git a/app/appearance/langs/it_IT.json b/app/appearance/langs/it_IT.json
index 12971630e..c48017f24 100644
--- a/app/appearance/langs/it_IT.json
+++ b/app/appearance/langs/it_IT.json
@@ -1654,6 +1654,8 @@
"266": "Tesseract OCR non è installato o configurato, fare riferimento alla Guida utente - Sezione file di risorse per la configurazione",
"267": "Database senza nome",
"268": "Attenzione: il file [%s] ha già superato [%d MB], il che potrebbe causare un calo delle prestazioni",
- "269": "Questo blocco è già stato aggiunto al database [%s]"
+ "269": "Questo blocco è già stato aggiunto al database [%s]",
+ "270": "Ottimizzazione dell'indice dei dati in corso, attendere prego...",
+ "271": "Ottimizzazione dell'indice dei dati completata, liberati [%s] di spazio su disco"
}
}
diff --git a/app/appearance/langs/ja_JP.json b/app/appearance/langs/ja_JP.json
index 4592526f5..4ea87be1a 100644
--- a/app/appearance/langs/ja_JP.json
+++ b/app/appearance/langs/ja_JP.json
@@ -1654,6 +1654,8 @@
"266": "Tesseract OCR がインストールされていないか、設定されていません。ユーザーガイド - リソースファイルセクションを参照して設定してください",
"267": "未命名のデータベース",
"268": "ファイル [%s] はすでに [%d MB] を超えており、パフォーマンスが低下する可能性があります",
- "269": "このブロックはすでにデータベース [%s] に追加されています"
+ "269": "このブロックはすでにデータベース [%s] に追加されています",
+ "270": "データインデックスを最適化しています。しばらくお待ちください...",
+ "271": "データインデックスの最適化が完了しました。合計 [%s] のディスク容量が解放されました"
}
}
diff --git a/app/appearance/langs/pl_PL.json b/app/appearance/langs/pl_PL.json
index 58d87f85b..f2c6dc9cc 100644
--- a/app/appearance/langs/pl_PL.json
+++ b/app/appearance/langs/pl_PL.json
@@ -1654,6 +1654,8 @@
"266": "Tesseract OCR nie jest zainstalowany lub skonfigurowany, zapoznaj się z Podręcznikiem użytkownika - Sekcja plików zasobów, aby skonfigurować",
"267": "Nienazwana baza danych",
"268": "Uwaga: plik [%s] przekroczył już [%d MB], co może spowodować spadek wydajności",
- "269": "Ten blok został już dodany do bazy danych [%s]"
+ "269": "Ten blok został już dodany do bazy danych [%s]",
+ "270": "Optymalizacja indeksu danych, proszę czekać...",
+ "271": "Optymalizacja indeksu danych zakończona, zwolniono [%s] miejsca na dysku"
}
}
diff --git a/app/appearance/langs/pt_BR.json b/app/appearance/langs/pt_BR.json
index f138a36ef..f543651ee 100644
--- a/app/appearance/langs/pt_BR.json
+++ b/app/appearance/langs/pt_BR.json
@@ -1654,6 +1654,8 @@
"266": "Tesseract OCR não está instalado ou configurado, consulte o Guia do Usuário - Seção de Arquivos de Recursos para configuração",
"267": "Banco de dados sem nome",
"268": "Atenção: o arquivo [%s] já excedeu [%d MB], o que pode causar queda de desempenho",
- "269": "Este bloco já foi adicionado ao banco de dados [%s]"
+ "269": "Este bloco já foi adicionado ao banco de dados [%s]",
+ "270": "Otimizando o índice de dados, por favor aguarde...",
+ "271": "Otimização do índice de dados concluída, [%s] de espaço liberado"
}
}
diff --git a/app/appearance/langs/ru_RU.json b/app/appearance/langs/ru_RU.json
index 9ad43b3b7..9d6c1711e 100644
--- a/app/appearance/langs/ru_RU.json
+++ b/app/appearance/langs/ru_RU.json
@@ -1654,6 +1654,8 @@
"266": "Tesseract OCR не установлен или не настроен, пожалуйста, обратитесь к Руководству пользователя - Раздел ресурсов для настройки",
"267": "База данных не названа",
"268": "Обратите внимание, что файл [%s] уже превышает [%d МБ], это может привести к снижению производительности",
- "269": "Этот блок уже добавлен в базу данных [%s]"
+ "269": "Этот блок уже добавлен в базу данных [%s]",
+ "270": "Оптимизация индекса данных, пожалуйста, подождите...",
+ "271": "Оптимизация индекса данных завершена, освобождено [%s] дискового пространства"
}
}
diff --git a/app/appearance/langs/zh_CHT.json b/app/appearance/langs/zh_CHT.json
index 008bc1af5..1f814b70c 100644
--- a/app/appearance/langs/zh_CHT.json
+++ b/app/appearance/langs/zh_CHT.json
@@ -1654,6 +1654,8 @@
"266": "Tesseract OCR 未安裝或未配置,請參考 用戶指南-資料文件 章節進行配置",
"267": "未命名資料庫",
"268": "請注意該檔案 [%s] 已經超過 [%d MB],可能會導致效能下降",
- "269": "該塊已經添加到資料庫 [%s] 中"
+ "269": "該塊已經添加到資料庫 [%s] 中",
+ "270": "正在優化資料索引,請稍等...",
+ "271": "資料索引優化完畢,共釋放 [%s] 磁碟空間"
}
}
diff --git a/app/appearance/langs/zh_CN.json b/app/appearance/langs/zh_CN.json
index 5d02ce44c..313ca32d7 100644
--- a/app/appearance/langs/zh_CN.json
+++ b/app/appearance/langs/zh_CN.json
@@ -1654,6 +1654,8 @@
"266": "Tesseract OCR 未安装或未配置,请参考 用户指南-资源文件 章节进行配置",
"267": "未命名数据库",
"268": "请注意该文件 [%s] 已经超过 [%d MB],可能会导致性能下降",
- "269": "该块已经添加到数据库 [%s] 中"
+ "269": "该块已经添加到数据库 [%s] 中",
+ "270": "正在优化数据索引,请稍等...",
+ "271": "数据索引优化完毕,共释放 [%s] 磁盘空间"
}
}
diff --git a/kernel/model/box.go b/kernel/model/box.go
index aae8667e2..966c6ab61 100644
--- a/kernel/model/box.go
+++ b/kernel/model/box.go
@@ -664,7 +664,46 @@ func normalizeTree(tree *parse.Tree) (yfmRootID, yfmTitle, yfmUpdated string) {
}
func VacuumDataIndex() {
-
+ util.PushEndlessProgress(Conf.language(270))
+ defer util.PushClearProgress()
+
+ var oldsyDbSize, newSyDbSize, oldHistoryDbSize, newHistoryDbSize, oldAssetContentDbSize, newAssetContentDbSize int64
+ info, _ := os.Stat(util.DBPath)
+ if nil != info {
+ oldsyDbSize = info.Size()
+ }
+ info, _ = os.Stat(util.HistoryDBPath)
+ if nil != info {
+ oldHistoryDbSize = info.Size()
+ }
+ info, _ = os.Stat(util.AssetContentDBPath)
+ if nil != info {
+ oldAssetContentDbSize = info.Size()
+ }
+
+ sql.Vacuum()
+
+ info, _ = os.Stat(util.DBPath)
+ if nil != info {
+ newSyDbSize = info.Size()
+ }
+ info, _ = os.Stat(util.HistoryDBPath)
+ if nil != info {
+ newHistoryDbSize = info.Size()
+ }
+ info, _ = os.Stat(util.AssetContentDBPath)
+ if nil != info {
+ newAssetContentDbSize = info.Size()
+ }
+
+ logging.LogInfof("vacuum database [siyuan.db: %s -> %s, history.db: %s -> %s, asset_content.db: %s -> %s]",
+ humanize.BytesCustomCeil(uint64(oldsyDbSize), 2), humanize.BytesCustomCeil(uint64(newSyDbSize), 2),
+ humanize.BytesCustomCeil(uint64(oldHistoryDbSize), 2), humanize.BytesCustomCeil(uint64(newHistoryDbSize), 2),
+ humanize.BytesCustomCeil(uint64(oldAssetContentDbSize), 2), humanize.BytesCustomCeil(uint64(newAssetContentDbSize), 2))
+
+ releaseSize := (oldsyDbSize - newSyDbSize) + (oldHistoryDbSize - newHistoryDbSize) + (oldAssetContentDbSize - newAssetContentDbSize)
+ msg := fmt.Sprintf(Conf.language(271), humanize.BytesCustomCeil(uint64(releaseSize), 2))
+ util.PushMsg(msg, 7000)
}
func FullReindex() {
diff --git a/kernel/sql/database.go b/kernel/sql/database.go
index 2c859d19d..e79dd8950 100644
--- a/kernel/sql/database.go
+++ b/kernel/sql/database.go
@@ -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
+}
From e4f0e02177c46bbd4f1306cced8a00bc7c1174a1 Mon Sep 17 00:00:00 2001
From: Daniel <845765@qq.com>
Date: Mon, 25 Aug 2025 11:39:22 +0800
Subject: [PATCH 08/14] :art: Manually optimize the data index to reduce space
usage and improve performance
https://github.com/siyuan-note/siyuan/issues/15663
---
app/src/mobile/settings/about.ts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/src/mobile/settings/about.ts b/app/src/mobile/settings/about.ts
index 592a34ca8..8b47b5a5e 100644
--- a/app/src/mobile/settings/about.ts
+++ b/app/src/mobile/settings/about.ts
@@ -304,7 +304,7 @@ export const initAbout = () => {
event.preventDefault();
event.stopPropagation();
break;
- } else if (target.id === "exportLog") {
+ } else if (target.id === "rebuildDataIndex") {
fetchPost("/api/system/rebuildDataIndex", {}, (response) => {});
event.preventDefault();
event.stopPropagation();
From 86018c5f499576b64fa5c052fc2356d17c54f59b Mon Sep 17 00:00:00 2001
From: Daniel <845765@qq.com>
Date: Mon, 25 Aug 2025 11:51:28 +0800
Subject: [PATCH 09/14] :art: Manually optimize the data index to reduce space
usage and improve performance
https://github.com/siyuan-note/siyuan/issues/15663
---
.../20230405172236-pg3l9eu.sy | 60 ++++++++++++++++++-
.../20230405155631-leo4vc6.sy | 60 ++++++++++++++++++-
.../20230405172131-yb16aax.sy | 60 ++++++++++++++++++-
.../20240530101000-flot1gj.sy | 60 +++++++++++++++++--
4 files changed, 228 insertions(+), 12 deletions(-)
diff --git a/app/guide/20210808180117-6v0mkxr/20230405172236-pg3l9eu.sy b/app/guide/20210808180117-6v0mkxr/20230405172236-pg3l9eu.sy
index 250a81083..0f9212b55 100644
--- a/app/guide/20210808180117-6v0mkxr/20230405172236-pg3l9eu.sy
+++ b/app/guide/20210808180117-6v0mkxr/20230405172236-pg3l9eu.sy
@@ -7,7 +7,7 @@
"id": "20230405172236-pg3l9eu",
"title": "Performance Optimization",
"type": "doc",
- "updated": "20240420104851"
+ "updated": "20250825114750"
},
"Children": [
{
@@ -379,7 +379,7 @@
"HeadingLevel": 3,
"Properties": {
"id": "20230405172238-v4hbjbe",
- "updated": "20230405172238"
+ "updated": "20250825114750"
},
"Children": [
{
@@ -637,6 +637,62 @@
]
}
]
+ },
+ {
+ "ID": "20250825114750-j9t49j2",
+ "Type": "NodeHeading",
+ "HeadingLevel": 3,
+ "Properties": {
+ "id": "20250825114750-j9t49j2",
+ "updated": "20250825114750"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "Optimizing the Index"
+ }
+ ]
+ },
+ {
+ "ID": "20250825114750-qtm8i82",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20250825114750-qtm8i82",
+ "updated": "20250825114750"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "It is recommended to regularly optimize the index by going to "
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "kbd",
+ "TextMarkTextContent": "Settings"
+ },
+ {
+ "Type": "NodeText",
+ "Data": " - "
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "kbd",
+ "TextMarkTextContent": "About"
+ },
+ {
+ "Type": "NodeText",
+ "Data": " - "
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "kbd",
+ "TextMarkTextContent": "Optimize Index"
+ },
+ {
+ "Type": "NodeText",
+ "Data": "."
+ }
+ ]
}
]
}
\ No newline at end of file
diff --git a/app/guide/20210808180117-czj9bvb/20230405155631-leo4vc6.sy b/app/guide/20210808180117-czj9bvb/20230405155631-leo4vc6.sy
index 22f53507f..39c013b85 100644
--- a/app/guide/20210808180117-czj9bvb/20230405155631-leo4vc6.sy
+++ b/app/guide/20210808180117-czj9bvb/20230405155631-leo4vc6.sy
@@ -7,7 +7,7 @@
"id": "20230405155631-leo4vc6",
"title": "性能优化",
"type": "doc",
- "updated": "20240420104842"
+ "updated": "20250825114628"
},
"Children": [
{
@@ -375,7 +375,7 @@
"HeadingLevel": 3,
"Properties": {
"id": "20230405171407-ltaakx8",
- "updated": "20230405171419"
+ "updated": "20250825114421"
},
"Children": [
{
@@ -633,6 +633,62 @@
]
}
]
+ },
+ {
+ "ID": "20250825114421-fq73tbi",
+ "Type": "NodeHeading",
+ "HeadingLevel": 3,
+ "Properties": {
+ "id": "20250825114421-fq73tbi",
+ "updated": "20250825114628"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "优化索引"
+ }
+ ]
+ },
+ {
+ "ID": "20250825114436-jm8dekc",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20250825114436-jm8dekc",
+ "updated": "20250825114628"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "建议定期执行优化索引 "
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "kbd",
+ "TextMarkTextContent": "设置"
+ },
+ {
+ "Type": "NodeText",
+ "Data": " - "
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "kbd",
+ "TextMarkTextContent": "关于"
+ },
+ {
+ "Type": "NodeText",
+ "Data": " - "
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "kbd",
+ "TextMarkTextContent": "优化索引"
+ },
+ {
+ "Type": "NodeText",
+ "Data": "。"
+ }
+ ]
}
]
}
\ No newline at end of file
diff --git a/app/guide/20211226090932-5lcq56f/20230405172131-yb16aax.sy b/app/guide/20211226090932-5lcq56f/20230405172131-yb16aax.sy
index 98f93b334..036bfc186 100644
--- a/app/guide/20211226090932-5lcq56f/20230405172131-yb16aax.sy
+++ b/app/guide/20211226090932-5lcq56f/20230405172131-yb16aax.sy
@@ -7,7 +7,7 @@
"id": "20230405172131-yb16aax",
"title": "性能最佳化",
"type": "doc",
- "updated": "20240420104915"
+ "updated": "20250825114942"
},
"Children": [
{
@@ -379,7 +379,7 @@
"HeadingLevel": 3,
"Properties": {
"id": "20230405172204-kitngfu",
- "updated": "20230405172204"
+ "updated": "20250825114815"
},
"Children": [
{
@@ -637,6 +637,62 @@
]
}
]
+ },
+ {
+ "ID": "20250825114815-of1bnnd",
+ "Type": "NodeHeading",
+ "HeadingLevel": 3,
+ "Properties": {
+ "id": "20250825114815-of1bnnd",
+ "updated": "20250825114942"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "優化索引"
+ }
+ ]
+ },
+ {
+ "ID": "20250825114815-ck2ln4u",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20250825114815-ck2ln4u",
+ "updated": "20250825114936"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "建議定期執行最佳化索引 "
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "kbd",
+ "TextMarkTextContent": "設定"
+ },
+ {
+ "Type": "NodeText",
+ "Data": " - "
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "kbd",
+ "TextMarkTextContent": "關於"
+ },
+ {
+ "Type": "NodeText",
+ "Data": " - "
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "kbd",
+ "TextMarkTextContent": "優化索引"
+ },
+ {
+ "Type": "NodeText",
+ "Data": "。"
+ }
+ ]
}
]
}
\ No newline at end of file
diff --git a/app/guide/20240530133126-axarxgx/20240530101000-flot1gj.sy b/app/guide/20240530133126-axarxgx/20240530101000-flot1gj.sy
index 5fb31b9fa..de8bbf503 100644
--- a/app/guide/20240530133126-axarxgx/20240530101000-flot1gj.sy
+++ b/app/guide/20240530133126-axarxgx/20240530101000-flot1gj.sy
@@ -8,7 +8,7 @@
"id": "20240530101000-flot1gj",
"title": "パフォーマンスの最適化",
"type": "doc",
- "updated": "20250115145306"
+ "updated": "20250825115021"
},
"Children": [
{
@@ -421,7 +421,7 @@
"Properties": {
"ID": "20240530101000-utjkzhs",
"id": "20240530101000-9doivgv",
- "updated": "20250115145306"
+ "updated": "20250825114907"
},
"Children": [
{
@@ -755,12 +755,60 @@
]
},
{
- "ID": "20240530101000-9swho08",
+ "ID": "20250825114907-tkuwv3h",
+ "Type": "NodeHeading",
+ "HeadingLevel": 3,
+ "Properties": {
+ "id": "20250825114907-tkuwv3h",
+ "updated": "20250825115021"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "インデックスの最適化"
+ }
+ ]
+ },
+ {
+ "ID": "20250825114907-av6973u",
"Type": "NodeParagraph",
"Properties": {
- "ID": "20240530101000-ugpv1is",
- "id": "20240530101000-9swho08"
- }
+ "id": "20250825114907-av6973u",
+ "updated": "20250825115021"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": ""
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "kbd",
+ "TextMarkTextContent": "設定"
+ },
+ {
+ "Type": "NodeText",
+ "Data": " - "
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "kbd",
+ "TextMarkTextContent": "バージョン情報"
+ },
+ {
+ "Type": "NodeText",
+ "Data": " - "
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "kbd",
+ "TextMarkTextContent": "インデックスの最適化"
+ },
+ {
+ "Type": "NodeText",
+ "Data": " から、定期的にインデックスを最適化することをお勧めします。"
+ }
+ ]
}
]
}
\ No newline at end of file
From 662aaa645832a2837e9fdaedb0ecabcd556ee21d Mon Sep 17 00:00:00 2001
From: Daniel <845765@qq.com>
Date: Mon, 25 Aug 2025 16:12:23 +0800
Subject: [PATCH 10/14] :art:
https://github.com/siyuan-note/siyuan/issues/15669
---
kernel/model/attribute_view.go | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/model/attribute_view.go b/kernel/model/attribute_view.go
index 7c9673e23..1b597aa20 100644
--- a/kernel/model/attribute_view.go
+++ b/kernel/model/attribute_view.go
@@ -3056,8 +3056,8 @@ func addAttributeViewBlock(now int64, avID, dbBlockID, groupID, previousItemID,
err = av.SaveAttributeView(attrView)
}
- msg := fmt.Sprintf(Conf.language(269), attrView.Name)
- context["message"] = msg
+ msg := fmt.Sprintf(Conf.language(269), getAttrViewName(attrView))
+ util.PushMsg(msg, 5000)
return
}
}
From 8ccb1e414320f7f85940db993f503710d3280d03 Mon Sep 17 00:00:00 2001
From: Daniel <845765@qq.com>
Date: Mon, 25 Aug 2025 16:13:43 +0800
Subject: [PATCH 11/14] :art: Manually optimize the data index to reduce space
usage and improve performance
https://github.com/siyuan-note/siyuan/issues/15663
---
app/src/config/about.ts | 4 ++--
app/src/mobile/settings/about.ts | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/app/src/config/about.ts b/app/src/config/about.ts
index 99a26df45..0a6843960 100644
--- a/app/src/config/about.ts
+++ b/app/src/config/about.ts
@@ -163,7 +163,7 @@ export const about = {