Improve data indexing performance for creating documents Fix https://github.com/siyuan-note/siyuan/issues/11005

This commit is contained in:
Daniel 2024-04-12 23:54:59 +08:00
parent 08208171be
commit fbce0bbf31
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -999,6 +999,11 @@ func deleteBlocksByIDs(tx *sql.Tx, ids []string) (err error) {
rowIDs = append(rowIDs, strconv.FormatInt(rowID, 10))
}
rows.Close()
if 1 > len(rowIDs) {
return
}
stmt = "DELETE FROM blocks WHERE ROWID IN (" + strings.Join(rowIDs, ",") + ")"
if err = execStmtTx(tx, stmt); nil != err {
return