gitlab-org--gitlab-foss/changelogs/unreleased/memoize-user-personal-projects-count.yml
Yorick Peterse ab738645a7
Memoize a user's personal projects count
The method User#projects_limit_left would run "personal_projects.count"
but such a query is not memoized. As a result multiple calls to
User#projects_limit_left would result in multiple COUNT(*) queries being
executed.

To work around this this commit adds User#personal_projects_count which
simply memoizes the result of the COUNT(*) in an instance variable.
2017-08-07 12:38:32 +02:00

4 lines
109 B
YAML

---
title: Memoize the number of personal projects a user has to reduce COUNT queries
merge_request:
author: