Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
e2ee145c
Commit
e2ee145c
authored
Sep 02, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
ffbaf106
f4e40c53
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
2 deletions
+31
-2
changelogs/unreleased/ab-admin-page-user-active-count.yml
changelogs/unreleased/ab-admin-page-user-active-count.yml
+5
-0
db/migrate/20190902131045_replace_indexes_for_counting_active_users.rb
...190902131045_replace_indexes_for_counting_active_users.rb
+23
-0
db/schema.rb
db/schema.rb
+3
-2
No files found.
changelogs/unreleased/ab-admin-page-user-active-count.yml
0 → 100644
View file @
e2ee145c
---
title
:
Replace indexes for counting active users
merge_request
:
32538
author
:
type
:
performance
db/migrate/20190902131045_replace_indexes_for_counting_active_users.rb
0 → 100644
View file @
e2ee145c
# frozen_string_literal: true
class
ReplaceIndexesForCountingActiveUsers
<
ActiveRecord
::
Migration
[
5.2
]
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
disable_ddl_transaction!
def
up
remove_concurrent_index_by_name
(
:users
,
'index_users_on_state_and_internal'
)
add_concurrent_index
(
:users
,
:state
,
where:
'ghost IS NOT TRUE'
,
name:
'index_users_on_state_and_internal'
)
add_concurrent_index
(
:users
,
:state
,
where:
'ghost IS NOT TRUE AND bot_type IS NULL'
,
name:
'index_users_on_state_and_internal_ee'
)
end
def
down
remove_concurrent_index_by_name
(
:users
,
'index_users_on_state_and_internal_ee'
)
remove_concurrent_index_by_name
(
:users
,
'index_users_on_state_and_internal'
)
add_concurrent_index
(
:users
,
:state
,
where:
'ghost <> true AND bot_type IS NULL'
,
name:
'index_users_on_state_and_internal'
)
end
end
db/schema.rb
View file @
e2ee145c
...
...
@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord
::
Schema
.
define
(
version:
2019_0
8_28_083843
)
do
ActiveRecord
::
Schema
.
define
(
version:
2019_0
9_02_131045
)
do
# These are extensions that must be enabled in order to support this database
enable_extension
"pg_trgm"
...
...
@@ -3551,7 +3551,8 @@ ActiveRecord::Schema.define(version: 2019_08_28_083843) do
t
.
index
[
"public_email"
],
name:
"index_users_on_public_email"
,
where:
"((public_email)::text <> ''::text)"
t
.
index
[
"reset_password_token"
],
name:
"index_users_on_reset_password_token"
,
unique:
true
t
.
index
[
"state"
],
name:
"index_users_on_state"
t
.
index
[
"state"
],
name:
"index_users_on_state_and_internal"
,
where:
"((ghost <> true) AND (bot_type IS NULL))"
t
.
index
[
"state"
],
name:
"index_users_on_state_and_internal"
,
where:
"(ghost IS NOT TRUE)"
t
.
index
[
"state"
],
name:
"index_users_on_state_and_internal_ee"
,
where:
"((ghost IS NOT TRUE) AND (bot_type IS NULL))"
t
.
index
[
"username"
],
name:
"index_users_on_username"
t
.
index
[
"username"
],
name:
"index_users_on_username_trigram"
,
opclass: :gin_trgm_ops
,
using: :gin
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment