Filter direct element children, by using the top element paths.
Instead of hitting heavily ElementPath
to list direct children by using the path__last
operator that is expensive, i'm listing all the paths for the requested elements, and using them directly.
This is way faster (from 6x to 10x faster depending on cases), and really noticeable when browsing a project through the frontend.
This adds another request for ListElementChildren
, but it's fast because it relies uniquely on the ElementPath.element_id
index, and then can use directly the ElementPath.path
index with the IN
clause instead of doing math...
Merge request reports
Activity
Codecov Report
Merging #1148 (e74006e0) into master (1ee755ed) will increase coverage by
0.00%
. The diff coverage is100.00%
.@@ Coverage Diff @@ ## master #1148 +/- ## ======================================= Coverage 87.97% 87.97% ======================================= Files 250 250 Lines 16470 16474 +4 ======================================= + Hits 14489 14493 +4 Misses 1981 1981
Impacted Files Coverage Δ arkindex/documents/api/elements.py 98.56% <100.00%> (+0.01%)
arkindex/documents/tests/test_children_elements.py 100.00% <100.00%> (ø)
arkindex/documents/tests/test_classes.py 100.00% <100.00%> (ø)
arkindex/documents/tests/test_destroy_elements.py 100.00% <100.00%> (ø)
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 1ee755e...e74006e. Read the comment docs.mentioned in commit 1c59ded2
mentioned in issue #602 (closed)