Skip to content

Significantly reduce N+1 queries in /api/v4/todos endpoint

Stan Hu requested to merge sh-optimize-todos-api into master

By preloading associations and batching issuable metadata lookups, we can significantly cut the number of SQL queries needed to load the Todos API endpoint.

On GitLab.com, my own tests showed my user's SQL queries went from 365 to under 60 SQL queries.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/40378

Edited by Stan Hu

Merge request reports