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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
05a6a71a
Commit
05a6a71a
authored
Jun 26, 2018
by
Kamil Trzciński
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add index on deployable_type/id for deployments
parent
7da7af3a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
1 deletion
+25
-1
changelogs/unreleased/add-missing-index-for-deployments.yml
changelogs/unreleased/add-missing-index-for-deployments.yml
+5
-0
db/migrate/20180626125654_add_index_on_deployable_for_deployments.rb
...20180626125654_add_index_on_deployable_for_deployments.rb
+18
-0
db/schema.rb
db/schema.rb
+2
-1
No files found.
changelogs/unreleased/add-missing-index-for-deployments.yml
0 → 100644
View file @
05a6a71a
---
title
:
Add index on deployable_type/id for deployments
merge_request
:
author
:
type
:
performance
db/migrate/20180626125654_add_index_on_deployable_for_deployments.rb
0 → 100644
View file @
05a6a71a
# See http://doc.gitlab.com/ce/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.
class
AddIndexOnDeployableForDeployments
<
ActiveRecord
::
Migration
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
disable_ddl_transaction!
def
up
add_concurrent_index
:deployments
,
[
:deployable_type
,
:deployable_id
]
end
def
down
remove_concurrent_index
:deployments
,
[
:deployable_type
,
:deployable_id
]
end
end
db/schema.rb
View file @
05a6a71a
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
#
#
# It's strongly recommended that you check this file into your version control system.
# It's strongly recommended that you check this file into your version control system.
ActiveRecord
::
Schema
.
define
(
version:
201806
08201435
)
do
ActiveRecord
::
Schema
.
define
(
version:
201806
26125654
)
do
# These are extensions that must be enabled in order to support this database
# These are extensions that must be enabled in order to support this database
enable_extension
"plpgsql"
enable_extension
"plpgsql"
...
@@ -757,6 +757,7 @@ ActiveRecord::Schema.define(version: 20180608201435) do
...
@@ -757,6 +757,7 @@ ActiveRecord::Schema.define(version: 20180608201435) do
end
end
add_index
"deployments"
,
[
"created_at"
],
name:
"index_deployments_on_created_at"
,
using: :btree
add_index
"deployments"
,
[
"created_at"
],
name:
"index_deployments_on_created_at"
,
using: :btree
add_index
"deployments"
,
[
"deployable_type"
,
"deployable_id"
],
name:
"index_deployments_on_deployable_type_and_deployable_id"
,
using: :btree
add_index
"deployments"
,
[
"environment_id"
,
"id"
],
name:
"index_deployments_on_environment_id_and_id"
,
using: :btree
add_index
"deployments"
,
[
"environment_id"
,
"id"
],
name:
"index_deployments_on_environment_id_and_id"
,
using: :btree
add_index
"deployments"
,
[
"environment_id"
,
"iid"
,
"project_id"
],
name:
"index_deployments_on_environment_id_and_iid_and_project_id"
,
using: :btree
add_index
"deployments"
,
[
"environment_id"
,
"iid"
,
"project_id"
],
name:
"index_deployments_on_environment_id_and_iid_and_project_id"
,
using: :btree
add_index
"deployments"
,
[
"project_id"
,
"iid"
],
name:
"index_deployments_on_project_id_and_iid"
,
unique:
true
,
using: :btree
add_index
"deployments"
,
[
"project_id"
,
"iid"
],
name:
"index_deployments_on_project_id_and_iid"
,
unique:
true
,
using: :btree
...
...
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