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
d2e6b95f
Commit
d2e6b95f
authored
Sep 02, 2020
by
Mehmet Emin INAC
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Introduce compound index on vulnerabilities to speed up migration
parent
0082d9f3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
0 deletions
+21
-0
db/migrate/20200826220745_add_compound_index_on_vulnerabilities_for_background_migration.rb
...ound_index_on_vulnerabilities_for_background_migration.rb
+18
-0
db/schema_migrations/20200826220745
db/schema_migrations/20200826220745
+1
-0
db/structure.sql
db/structure.sql
+2
-0
No files found.
db/migrate/20200826220745_add_compound_index_on_vulnerabilities_for_background_migration.rb
0 → 100644
View file @
d2e6b95f
# frozen_string_literal: true
class
AddCompoundIndexOnVulnerabilitiesForBackgroundMigration
<
ActiveRecord
::
Migration
[
6.0
]
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
INDEX_NAME
=
'index_vulnerabilities_on_project_id_and_id'
disable_ddl_transaction!
def
up
add_concurrent_index
:vulnerabilities
,
[
:project_id
,
:id
],
name:
INDEX_NAME
end
def
down
remove_concurrent_index_by_name
:vulnerabilities
,
INDEX_NAME
end
end
db/schema_migrations/20200826220745
0 → 100644
View file @
d2e6b95f
ee38dd60087a8879c4686214da1d25a60ab74306eb07b938efb1a8dfc46cc73a
\ No newline at end of file
db/structure.sql
View file @
d2e6b95f
...
...
@@ -21038,6 +21038,8 @@ CREATE INDEX index_vulnerabilities_on_milestone_id ON public.vulnerabilities USI
CREATE
INDEX
index_vulnerabilities_on_project_id
ON
public
.
vulnerabilities
USING
btree
(
project_id
);
CREATE
INDEX
index_vulnerabilities_on_project_id_and_id
ON
public
.
vulnerabilities
USING
btree
(
project_id
,
id
);
CREATE
INDEX
index_vulnerabilities_on_resolved_by_id
ON
public
.
vulnerabilities
USING
btree
(
resolved_by_id
);
CREATE
INDEX
index_vulnerabilities_on_start_date_sourcing_milestone_id
ON
public
.
vulnerabilities
USING
btree
(
start_date_sourcing_milestone_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