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
144c4269
Commit
144c4269
authored
Mar 26, 2021
by
Mike Kozono
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add index to improve performance
of the projects deployments API endpoint.
parent
5f62cd3e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
0 deletions
+27
-0
changelogs/unreleased/mk-add-index-for-project-deployments-with-environment-id-and-updated-at.yml
...roject-deployments-with-environment-id-and-updated-at.yml
+5
-0
db/migrate/20210326035553_add_index_for_project_deployments_with_environment_id_and_updated_at.rb
...project_deployments_with_environment_id_and_updated_at.rb
+19
-0
db/schema_migrations/20210326035553
db/schema_migrations/20210326035553
+1
-0
db/structure.sql
db/structure.sql
+2
-0
No files found.
changelogs/unreleased/mk-add-index-for-project-deployments-with-environment-id-and-updated-at.yml
0 → 100644
View file @
144c4269
---
title
:
Add index to improve project deployments endpoint performance
merge_request
:
57554
author
:
type
:
performance
db/migrate/20210326035553_add_index_for_project_deployments_with_environment_id_and_updated_at.rb
0 → 100644
View file @
144c4269
# frozen_string_literal: true
class
AddIndexForProjectDeploymentsWithEnvironmentIdAndUpdatedAt
<
ActiveRecord
::
Migration
[
6.0
]
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
disable_ddl_transaction!
INDEX_NAME
=
'index_deployments_on_project_and_environment_and_updated_at'
def
up
add_concurrent_index
:deployments
,
[
:project_id
,
:environment_id
,
:updated_at
],
name:
INDEX_NAME
end
def
down
remove_concurrent_index_by_name
:deployments
,
INDEX_NAME
end
end
db/schema_migrations/20210326035553
0 → 100644
View file @
144c4269
018381c15d859a777afb2b3402ca4425ce52ab35dcd4d1e930b3a9928b2a2019
\ No newline at end of file
db/structure.sql
View file @
144c4269
...
...
@@ -22462,6 +22462,8 @@ CREATE INDEX index_deployments_on_id_and_status_and_created_at ON deployments US
CREATE INDEX index_deployments_on_id_where_cluster_id_present ON deployments USING btree (id) WHERE (cluster_id IS NOT NULL);
CREATE INDEX index_deployments_on_project_and_environment_and_updated_at ON deployments USING btree (project_id, environment_id, updated_at);
CREATE INDEX index_deployments_on_project_and_finished ON deployments USING btree (project_id, finished_at) WHERE (status = 2);
CREATE INDEX index_deployments_on_project_id_and_id ON deployments USING btree (project_id, id DESC);
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