Speed up Open list when there are assignee lists
What does this MR do?
When there is an assignee list and the board can show a lot of issues,
the Open list can be very slow. This was because the query was
essentially repeated inside a NOT IN
to exclude issues that are assigned
to someone from one of the assignee lists.
Instead, we can simplify the inner query to be a more direct one:
NOT EXISTS (
SELECT 1
FROM issue_assignees
WHERE user_id IN ($assignee_list_users)
AND issue_id = issues.id
)
Which also performs much better, as well as being simpler to understand.
What are the relevant issue numbers?
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/51184.
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary -
Conforms to the code review guidelines -
Conforms to the merge request performance guidelines -
Conforms to the style guides -
Conforms to the database guides -
EE specific content should be in the top level /ee
folder -
Security reports checked/validated by reviewer