fix(trashbin): Fix n+1 issue in propfind in trash root#54317
fix(trashbin): Fix n+1 issue in propfind in trash root#54317CarlSchwan wants to merge 3 commits intomasterfrom
Conversation
|
This doesn't work with the group folder app as the content of the trash is stored in |
So it breaks stuff with groupfolders? |
doesn't break it but also doesn't fix the similar issue there... I'm trying to rethink a bit how to do it so that it works for every trash backend |
e574092 to
9df9b4a
Compare
Found a solution, this adds a method to the ITrashBackend branch. I'm not sure it is allowed as it is an API break but then it's also in OCA and not OCP and we release the groupfolder app at the same time as server. Worst case, I can just add an interface :) |
9c07e5a to
0d37a55
Compare
| * @return Folder[] | ||
| * @since 32.0.0 | ||
| */ | ||
| public function getTrashRootsForUser(IUser $user): array; |
There was a problem hiding this comment.
This would encode further assumptions about how trash items are stored. If we ever want to expose "deleted but versioned" s3 objects or deleted items from filesystem snapshots this could be problematic.
There was a problem hiding this comment.
Right, I wonder if there is a better way to do it. the list of Folder is really only used for pre-caching them and does not necessarily need to be exhaustive for this usecase
This comment was marked as off-topic.
This comment was marked as off-topic.
3938b32 to
684df76
Compare
684df76 to
9b3efb3
Compare
9b3efb3 to
a015a44
Compare
CustomPropertiesBackend is already able to cache the custom properties of a folder content. But the trash root is not a Directory but instead just a ICollection, so extend CacheEntry to also handle a TrashEntry. Signed-off-by: Carl Schwan <carl.schwan@nextclound.com>
That interface can be implemented by any ICollection that is based on one or multiple \OCP\Files\Folder to pre-fetch the custom properties. Signed-off-by: Carl Schwan <carl.schwan@nextclound.com>
2a31509 to
4fe75a6
Compare
Introduze a LazyMountPoint which is similar to LazyFile/LazyFolder and allow to avoid doing DB request when we just want the storage id and we already have it. Signed-off-by: Carl Schwan <carlschwan@kde.org>
4fe75a6 to
70d62d7
Compare
Summary
CustomPropertiesBackend is already able to cache the custom properties of a folder content. But the trash root is not a Directory but instead just a ICollection, so extend CacheEntry to also handle a TrashEntry.
DB queries before (with around 30 entries in trash, around half from a groupfolder):
DB queries after:
TODO
Checklist