Improve performance for rendering databases, due flashcards

This commit is contained in:
Daniel 2024-06-23 21:37:28 +08:00
parent 65f24b376e
commit 06f3721fd4
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
6 changed files with 36 additions and 7 deletions

View file

@ -111,6 +111,7 @@ func RenderAttributeViewTable(attrView *av.AttributeView, view *av.View, query s
// 过滤掉不存在的行
var notFound []string
var toCheckBlockIDs []string
for blockID, keyValues := range rows {
blockValue := getRowBlockValue(keyValues)
if nil == blockValue {
@ -127,7 +128,11 @@ func RenderAttributeViewTable(attrView *av.AttributeView, view *av.View, query s
continue
}
if nil == treenode.GetBlockTree(blockID) {
toCheckBlockIDs = append(toCheckBlockIDs, blockID)
}
checkRet := treenode.ExistBlockTrees(toCheckBlockIDs)
for blockID, exist := range checkRet {
if !exist {
notFound = append(notFound, blockID)
}
}