Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorick Peterse <yorickpeterse@gmail.com>2017-08-04 17:43:01 +0300
committerYorick Peterse <yorickpeterse@gmail.com>2017-08-07 13:38:32 +0300
commitab738645a7b5bba46c8bf50f0780e66befc8bbe2 (patch)
treea053f0114731ec4c759171cd83dcb6468fefa03a /changelogs
parent4a915c739d502a8b1d2a019f4352d46a3be3d7e0 (diff)
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.
Diffstat (limited to 'changelogs')
-rw-r--r--changelogs/unreleased/memoize-user-personal-projects-count.yml4
1 files changed, 4 insertions, 0 deletions
diff --git a/changelogs/unreleased/memoize-user-personal-projects-count.yml b/changelogs/unreleased/memoize-user-personal-projects-count.yml
new file mode 100644
index 00000000000..3839a97f185
--- /dev/null
+++ b/changelogs/unreleased/memoize-user-personal-projects-count.yml
@@ -0,0 +1,4 @@
+---
+title: Memoize the number of personal projects a user has to reduce COUNT queries
+merge_request:
+author: