Save a query on the todos index page

Merged username-removed-443319 requested to merge save-a-query-on-todos-with-no-filters into master

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:

image

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

None - I just noticed it.

Edited by yorickpeterse-staging