Skip to content

Conversation

lunika
Copy link
Member

@lunika lunika commented Oct 16, 2025

Purpose

The trashbin endpoint is slow. To filter documents the user has owner access, we use a subquery to compute the roles and then filter on this subquery. This is very slow. To improve it, we use the same way to filter children used in the tree endpoint. First we look for all highest ancestors the user has access on with the owner role. Then we create one queryset filtering on all the docs starting by the given path and are deleted.

Proposal

  • ⚡️(backend) improve trashbin endpoint performance

@lunika lunika requested review from qbey and sampaccoud October 16, 2025 14:00
@lunika lunika self-assigned this Oct 16, 2025
@lunika lunika added the enhancement improve an existing feature label Oct 16, 2025
The trashbin endpoint is slow. To filter documents the user has owner
access, we use a subquery to compute the roles and then filter on this
subquery. This is very slow. To improve it, we use the same way to
filter children used in the tree endpoint. First we look for all highest
ancestors the user has access on with the owner role. Then we create one
queryset filtering on all the docs starting by the given path and are
deleted.
@lunika lunika force-pushed the fix/slow-trashbin-endpoint branch from 60afb28 to 61b4a73 Compare October 16, 2025 14:42
@lunika lunika enabled auto-merge (squash) October 16, 2025 14:42
@lunika lunika disabled auto-merge October 16, 2025 14:42
@lunika lunika enabled auto-merge (squash) October 16, 2025 14:42
@lunika lunika disabled auto-merge October 16, 2025 14:57
@lunika lunika merged commit 5908afb into main Oct 16, 2025
21 of 22 checks passed
@lunika lunika deleted the fix/slow-trashbin-endpoint branch October 16, 2025 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement improve an existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants