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
f13cebce
Commit
f13cebce
authored
Apr 02, 2020
by
Tiger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add clusters index to improve usage data queries
parent
7626fad2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
0 deletions
+27
-0
changelogs/unreleased/add-missing-cluster-usage-data-index.yml
...elogs/unreleased/add-missing-cluster-usage-data-index.yml
+5
-0
db/migrate/20200402001106_add_cluster_type_index_to_clusters.rb
...rate/20200402001106_add_cluster_type_index_to_clusters.rb
+19
-0
db/structure.sql
db/structure.sql
+3
-0
No files found.
changelogs/unreleased/add-missing-cluster-usage-data-index.yml
0 → 100644
View file @
f13cebce
---
title
:
Add clusters index to improve usage data queries
merge_request
:
28626
author
:
type
:
performance
db/migrate/20200402001106_add_cluster_type_index_to_clusters.rb
0 → 100644
View file @
f13cebce
# frozen_string_literal: true
class
AddClusterTypeIndexToClusters
<
ActiveRecord
::
Migration
[
6.0
]
include
Gitlab
::
Database
::
MigrationHelpers
# Set this constant to true if this migration requires downtime.
DOWNTIME
=
false
INDEX_NAME
=
'index_clusters_on_enabled_cluster_type_id_and_created_at'
disable_ddl_transaction!
def
up
add_concurrent_index
:clusters
,
[
:enabled
,
:cluster_type
,
:id
,
:created_at
],
name:
INDEX_NAME
end
def
down
remove_concurrent_index_by_name
:clusters
,
INDEX_NAME
end
end
db/structure.sql
View file @
f13cebce
...
...
@@ -9079,6 +9079,8 @@ CREATE INDEX index_clusters_kubernetes_namespaces_on_project_id ON public.cluste
CREATE
INDEX
index_clusters_on_enabled_and_provider_type_and_id
ON
public
.
clusters
USING
btree
(
enabled
,
provider_type
,
id
);
CREATE
INDEX
index_clusters_on_enabled_cluster_type_id_and_created_at
ON
public
.
clusters
USING
btree
(
enabled
,
cluster_type
,
id
,
created_at
);
CREATE
INDEX
index_clusters_on_management_project_id
ON
public
.
clusters
USING
btree
(
management_project_id
)
WHERE
(
management_project_id
IS
NOT
NULL
);
CREATE
INDEX
index_clusters_on_user_id
ON
public
.
clusters
USING
btree
(
user_id
);
...
...
@@ -13200,6 +13202,7 @@ COPY "schema_migrations" (version) FROM STDIN;
20200331220930
20200401095430
20200401211005
20200402001106
20200402123926
20200402124802
20200402135250
...
...
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