Skip to content

[stable33] Performance optimisation for high number of team folders#4338

Merged
provokateurin merged 3 commits intostable33from
backport/4320/stable33
Feb 5, 2026
Merged

[stable33] Performance optimisation for high number of team folders#4338
provokateurin merged 3 commits intostable33from
backport/4320/stable33

Conversation

@backportbot
Copy link
Copy Markdown

@backportbot backportbot bot commented Feb 5, 2026

Backport of PR #4320

@backportbot backportbot bot requested review from Rello and provokateurin February 5, 2026 06:41
@backportbot backportbot bot added the 3. to review Items that need to be reviewed label Feb 5, 2026
@backportbot backportbot bot added this to the Nextcloud 33 milestone Feb 5, 2026
Rello added 3 commits February 5, 2026 06:41
Motivation

Avoid full-table scans and high-memory iterations when checking mountpoints by using a targeted lookup instead of iterating all folders.
Reduce global table reads for applicable/group mappings by scoping queries to only requested folder IDs.
Description

Replace loop-based mountpoint existence check in lib/Controller/FolderController.php with a call to FolderManager::mountPointExists() to perform a single targeted query.
Add mountPointExists() to lib/Folder/FolderManager.php to check for a mount point using a single-row query.
Introduce getApplicableForFolders() and getApplicableForFolder() and getFolderMappingsForFolders() in lib/Folder/FolderManager.php to fetch applicable groups/circles and manage mappings for a specified list of folder IDs.
Update getAllFoldersWithSize(), getAllFoldersForUserWithSize(), getFolder(), getGroups(), and getCircles() to use the new scoped helpers instead of loading all applicable/mapping rows, including safe early-return when the folder ID list is empty.

Signed-off-by: Rello <Rello@users.noreply.github.com>
Signed-off-by: Rello <Rello@users.noreply.github.com>
Signed-off-by: Rello <Rello@users.noreply.github.com>
@provokateurin provokateurin merged commit 0100343 into stable33 Feb 5, 2026
54 checks passed
@provokateurin provokateurin deleted the backport/4320/stable33 branch February 5, 2026 06:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Items that need to be reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants