Skip to content

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?

What are the relevant issue numbers?

Closes #6064 (closed)

Edited by Andreas Brandl

Merge request reports