nextcloud / nextcloud/groupfolders
Performance: Multiple Identical SQL lookups within ACLPlugin
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 343
- Forks
- 106
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 34
Description
How to use GitHub
- Please use the 👍 reaction to show that you are interested into the same feature.
- Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
- Subscribe to receive notifications on status change and new comments.
Is your feature request related to a problem? Please describe.
In ACLPlugin.php, RuleManager->getRulesForFilesByPath() causes repeated SQL lookups with the same parameters to calculate inhereted ACL Lists (50 identical queries for 50 children).
Also, propFind re-computes isAdmin (and therefore folderManager->canManageACL(...)) which in FolderManager can call getManagerMappings() repeatedly and cause another SQL lookup, even though the result depends on the containing group folder.
Describe the solution you'd like
Ideally, add memoization per-request in ACLPlugin for the result of getRulesForFilesByPath to reduce SQL lookups.
Also, add internal caching to FolderManager->getManagerMappings().
Describe alternatives you've considered
__
Additional context
ACLManager has an in-memory cache but is not used by ACLPlugin->propFind().
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in ACLPlugin.php at RuleManager->getRulesForFilesByPath() and propFind(), then trace FolderManager->canManageACL() and getManagerMappings(). Confirm which repeated lookups share request-scoped inputs and preserve ACL behavior while reducing duplicate SQL lookups in both paths.】【。}સәи თითქjson malformed? There's weird Armenian? Need fix. Also research says two to four sentences; 2 sentences. JSON valid. Ensure no claim beyond.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- authorization, backend, performance
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100