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
b3bda708
Commit
b3bda708
authored
Mar 16, 2020
by
alinamihaila
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Optimize ldap keys counters query performance for usage data
parent
015cfbc7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
1 deletion
+25
-1
changelogs/unreleased/208234-optimize-ldap-keys-in-usage-data.yml
...gs/unreleased/208234-optimize-ldap-keys-in-usage-data.yml
+5
-0
db/migrate/20200316111759_add_index_on_id_and_ldap_key_to_keys.rb
...te/20200316111759_add_index_on_id_and_ldap_key_to_keys.rb
+18
-0
db/schema.rb
db/schema.rb
+2
-1
No files found.
changelogs/unreleased/208234-optimize-ldap-keys-in-usage-data.yml
0 → 100644
View file @
b3bda708
---
title
:
Optimize ldap keys counters query performance in usage data
merge_request
:
27309
author
:
type
:
performance
db/migrate/20200316111759_add_index_on_id_and_ldap_key_to_keys.rb
0 → 100644
View file @
b3bda708
# frozen_string_literal: true
class
AddIndexOnIdAndLdapKeyToKeys
<
ActiveRecord
::
Migration
[
6.0
]
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
INDEX_NAME
=
'index_keys_on_id_and_ldap_key_type'
disable_ddl_transaction!
def
up
add_concurrent_index
:keys
,
[
:id
,
:type
],
where:
"type = 'LDAPKey'"
,
name:
INDEX_NAME
end
def
down
remove_concurrent_index
:keys
,
INDEX_NAME
end
end
db/schema.rb
View file @
b3bda708
...
...
@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord
::
Schema
.
define
(
version:
2020_03_1
3_123934
)
do
ActiveRecord
::
Schema
.
define
(
version:
2020_03_1
6_111759
)
do
# These are extensions that must be enabled in order to support this database
enable_extension
"pg_trgm"
...
...
@@ -2309,6 +2309,7 @@ ActiveRecord::Schema.define(version: 2020_03_13_123934) do
t
.
datetime_with_timezone
"expires_at"
t
.
index
[
"fingerprint"
],
name:
"index_keys_on_fingerprint"
,
unique:
true
t
.
index
[
"fingerprint_sha256"
],
name:
"index_keys_on_fingerprint_sha256"
t
.
index
[
"id"
,
"type"
],
name:
"index_keys_on_id_and_ldap_key_type"
,
where:
"((type)::text = 'LDAPKey'::text)"
t
.
index
[
"id"
,
"type"
],
name:
"index_on_deploy_keys_id_and_type_and_public"
,
unique:
true
,
where:
"(public = true)"
t
.
index
[
"last_used_at"
],
name:
"index_keys_on_last_used_at"
,
order:
"DESC NULLS LAST"
t
.
index
[
"user_id"
],
name:
"index_keys_on_user_id"
...
...
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