Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lighter request on circle memberships #3571

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ArtificialOwl
Copy link
Member

@ArtificialOwl ArtificialOwl commented Jan 28, 2025

linked to nextcloud/circles#1851

  • add index to group_folders_groups.circle_id alone
  • avoid useless LEFT JOIN on request (if lighter link to memberships circles#1851 applied)
  • filters on empty circle_id to not search circles on 'group' groupfolders

new request:

SELECT
    `f`.`folder_id`,
[...]
    `a`.`permissions` AS `group_permissions`,
    `c`.`permissions` AS `permissions`
FROM
    `oc_group_folders` `f`
INNER JOIN `oc_group_folders_groups` `a` ON
    `f`.`folder_id` = `a`.`folder_id`
LEFT JOIN `oc_filecache` `c` ON
    (`c`.`name` = CONCAT(`f`.`folder_id`, '')) AND(`c`.`parent` = '185') AND(`c`.`storage` = '2')
INNER JOIN `oc_circles_membership` `w_j` ON
    (
        `w_j`.`single_id` = 'ysdjkgfhdslkjghalkj'
    ) AND(`w_j`.`circle_id` = `a`.`circle_id`)
WHERE
    `a`.`circle_id` <> ''

@ArtificialOwl ArtificialOwl force-pushed the fix/noid/improve-team-folders branch from 5f1e6bd to 917ce3c Compare January 28, 2025 12:22
@ArtificialOwl ArtificialOwl force-pushed the fix/noid/improve-team-folders branch from 917ce3c to 82f40cf Compare January 28, 2025 12:29
Copy link
Member

@provokateurin provokateurin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A test would be nice to ensure the intended results are returned from the query.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants