mirror of
https://github.com/zadam/trilium.git
synced 2025-11-07 15:09:01 +01:00
fix(collapse-subtree): improve performance of collapsing subtrees from O(n) to O(v)
Only collapse currently expanded descendants instead of the entire subtree. Assuming n is the number of subnotes and v is the number of opened notes
This commit is contained in:
parent
1b711e2c08
commit
1fc38e941e
@ -163,6 +163,7 @@ function setExpandedForSubtree(req: Request) {
|
|||||||
SELECT branches.branchId, branches.noteId FROM branches
|
SELECT branches.branchId, branches.noteId FROM branches
|
||||||
JOIN tree ON branches.parentNoteId = tree.noteId
|
JOIN tree ON branches.parentNoteId = tree.noteId
|
||||||
WHERE branches.isDeleted = 0
|
WHERE branches.isDeleted = 0
|
||||||
|
AND branches.isExpanded = 1
|
||||||
)
|
)
|
||||||
SELECT branchId FROM tree`,
|
SELECT branchId FROM tree`,
|
||||||
[branchId]
|
[branchId]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user