Geo: Improve Geo Status API performance with cached counters in SiteStatistic
What does this MR do?
Creates a SiteStatistic
model and table to track repositories_count
and wikis_count
to be used by the Geo health check API.
Are there points in the code the reviewer needs to double check?
See CE backport first: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20413
Why was this MR needed?
We tried to optimize the query but there is a limit on how much we can force Postgres to do, and the tentative to create a specific tailored index failed.
This cannot be implemented as a database trigger (see discussion here: https://gitlab.slack.com/archives/C3NBYFJ6N/p1530260766000012), so the alternative is to use ActiveRecord hooks.
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary -
Tests added for this feature/bug - Conform by the code review guidelines
-
Has been reviewed by a Backend maintainer -
Has been reviewed by a Database specialist
-
-
EE specific content should be in the top level /ee
folder -
Conform by the merge request performance guides -
Conform by the style guides -
End-to-end tests pass ( package-and-qa
manual pipeline job)
What are the relevant issue numbers?
Closes #6064 (closed)
Edited by Andreas Brandl