nextcloud / nextcloud/circles

Full database table scan oc_circles_circle/oc_circles_member

Open
#1,622 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

1. to develop bug
Dominant language
JavaScript
Stars
177
Forks
68
Avg merge
2d 22h
Merged PRs (30d)
60

Description

Query Id: 840cd7ddd2b35ffc135ea23c59096c00

SELECT
  `cs`.`unique_id`,
  `cs`.`name`,
  `cs`.`display_name`,
  `cs`.`sanitized_name`,
  `cs`.`source`,
  `cs`.`description`,
  `cs`.`settings`,
  `cs`.`config`,
  `cs`.`contact_addressbook`,
  `cs`.`contact_groupname`,
  `cs`.`creation`
FROM
  `oc_circles_circle` `cs`
  INNER JOIN `oc_circles_member` `cs_mm` ON `cs_mm`.`circle_id` = `cs`.`unique_id`
WHERE
  (`cs`.`instance` = ?)
  AND (
    (`cs_mm`.`user_id` = ?)
    AND (`cs_mm`.`user_type` = ?)
    AND (`cs_mm`.`level` >= ?)
  )
  AND ((`cs`.`config` & ?) > ?)

Nextcloud 27.1.11

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the reported SQL query and inspect the execution plan for the oc_circles_circle and oc_circles_member tables, including how the instance, user_id, user_type, level, and circle_id conditions are handled. Done means the reported full table scan is addressed and the query remains correct on Nextcloud 27.1.11.

Written by the indexing model from the issue text.

Assessment

Tech stack
sql
Domain
databases, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.