Don't use ProjectsFinder in TodosFinder
What does this MR do?
Using ProjectsFinder in TodosFinder to limit todos to the right projects leads to overly complicated and slow database queries. This commit removes the use of ProjectsFinder in favour of using Project.public_or_visible_to_current_user directly.
Per https://gitlab.com/gitlab-com/infrastructure/issues/3772#note_61217294 getting rid of the redundant AND (mentioned in https://gitlab.com/gitlab-org/gitlab-ce/issues/43767) appears to cut query timings in half.
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary - Review
-
Has been reviewed by Backend -
Has been reviewed by Database
-
-
Conform by the merge request performance guides -
Conform by the style guides -
Squashed related commits together
What are the relevant issue numbers?
Edited by Yorick Peterse