diff options
author | Andreas Brandl <abrandl@gitlab.com> | 2019-09-02 15:15:26 +0200 |
---|---|---|
committer | Andreas Brandl <abrandl@gitlab.com> | 2019-09-02 15:22:32 +0200 |
commit | 5b4108f0fd68956ff5146f2ff6e8a29ed4eb7850 (patch) | |
tree | 357ffa8a54e164e8055a5bcfc950f3ef429d7d1f /changelogs | |
parent | 60fd42172fcf790b3cb612a3403227d4a97035a6 (diff) | |
download | gitlab-ce-5b4108f0fd68956ff5146f2ff6e8a29ed4eb7850.tar.gz |
Replace indexes for counting active usersab-admin-page-user-active-count
This adjusts the partial condition for an index. The index is intended
to be used when counting active users with `ghost IS NOT TRUE AND
bot_type IS NULL`.
With the current index, this wasn't working as the partial condition
didn't match the query: `ghost <> TRUE` is not semantically equivalent
to `ghost IS NOT TRUE` (null semantics).
The reason we add an index particularly intended for EE is that the EE
query is going to have the additional part `AND bot_type IS NULL`
whereas the CE query doesn't. Logically, it'd be enough to have an index
for `ghost IS NOT TRUE`. However, on GitLab.com, the query planner makes
poor choices when the additional `AND bot_type IS NULL` part is present:
It goes for the index on `bot_type` and doesn't use the partial index.
Note the existing index isn't being used at all according to GitLab.com
index statistics. Hence we can first remove it and don't have to worry
about the window of time without an index.
Relates to https://gitlab.com/gitlab-org/gitlab-ce/issues/66770
Diffstat (limited to 'changelogs')
-rw-r--r-- | changelogs/unreleased/ab-admin-page-user-active-count.yml | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/changelogs/unreleased/ab-admin-page-user-active-count.yml b/changelogs/unreleased/ab-admin-page-user-active-count.yml new file mode 100644 index 00000000000..e08715a1586 --- /dev/null +++ b/changelogs/unreleased/ab-admin-page-user-active-count.yml @@ -0,0 +1,5 @@ +--- +title: Replace indexes for counting active users +merge_request: 32538 +author: +type: performance |