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 /.dockerignore | |
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 '.dockerignore')
0 files changed, 0 insertions, 0 deletions