Save a query on the todos index page
What does this MR do?
When you're viewing the todos index without filters, use the cached value on the user object to get the total number of todos, rather than performing another query.
Are there points in the code the reviewer needs to double check?
Not sure. This is like https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/13805, but simpler.
Why was this MR needed?
This query was the slowest on the todos page for me, and we don't even need it:
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary -
Tests added for this feature/bug - 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?
None - I just noticed it.
Edited by yorickpeterse-staging