优化加载后删除节点的逻辑;和数据库查询性能
This commit is contained in:
@@ -488,6 +488,7 @@ class DataCollection:
|
||||
context=context_value,
|
||||
)
|
||||
node.context["_loaded_from_persistence"] = True
|
||||
node.append_log("加载来源: persistence 恢复节点")
|
||||
except Exception:
|
||||
import logging
|
||||
logger = logging.getLogger(__name__)
|
||||
@@ -623,6 +624,7 @@ class DataCollection:
|
||||
context=context_value,
|
||||
)
|
||||
node.context["_loaded_from_persistence"] = True
|
||||
node.append_log("加载来源: persistence 恢复节点")
|
||||
self._nodes[node.node_id] = node
|
||||
|
||||
if node.data_id and node.data_id != "":
|
||||
|
||||
@@ -112,6 +112,9 @@ class SQLitePersistenceBackend(PersistenceBackend):
|
||||
await self.conn.execute(
|
||||
"CREATE INDEX IF NOT EXISTS idx_nodes_collection_scope_data_id ON nodes (collection_id, scope, data_id)"
|
||||
)
|
||||
await self.conn.execute(
|
||||
"CREATE INDEX IF NOT EXISTS idx_nodes_scope_type_node_id ON nodes (scope, node_type, node_id)"
|
||||
)
|
||||
|
||||
async def _ensure_bindings_schema(self) -> None:
|
||||
assert self.conn is not None
|
||||
|
||||
Reference in New Issue
Block a user