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
696ff2ae
Commit
696ff2ae
authored
Oct 19, 2020
by
Borivoje Tasovac
Committed by
Adam Hegyi
Oct 19, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove compound index on (project_id, id) from vulnerabilities table
parent
a525107c
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
2 deletions
+23
-2
changelogs/unreleased/remove-project-id-and-id-index-on-vulnerabilities-table.yml
...move-project-id-and-id-index-on-vulnerabilities-table.yml
+5
-0
db/migrate/20201004163918_remove_project_id_and_id_index_from_vulnerabilities_table.rb
...ove_project_id_and_id_index_from_vulnerabilities_table.rb
+17
-0
db/schema_migrations/20201004163918
db/schema_migrations/20201004163918
+1
-0
db/structure.sql
db/structure.sql
+0
-2
No files found.
changelogs/unreleased/remove-project-id-and-id-index-on-vulnerabilities-table.yml
0 → 100644
View file @
696ff2ae
---
title
:
Remove duplicate index from the Vulnerabilities table
merge_request
:
44422
author
:
Borivoje Tasovac @borivojetasovac
type
:
performance
db/migrate/20201004163918_remove_project_id_and_id_index_from_vulnerabilities_table.rb
0 → 100644
View file @
696ff2ae
class
RemoveProjectIdAndIdIndexFromVulnerabilitiesTable
<
ActiveRecord
::
Migration
[
6.0
]
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
INDEX_NAME
=
'index_vulnerabilities_on_project_id_and_id'
disable_ddl_transaction!
def
up
Gitlab
::
BackgroundMigration
.
steal
(
'PopulateResolvedOnDefaultBranchColumn'
)
remove_concurrent_index_by_name
:vulnerabilities
,
INDEX_NAME
end
def
down
add_concurrent_index
:vulnerabilities
,
[
:project_id
,
:id
],
name:
INDEX_NAME
end
end
db/schema_migrations/20201004163918
0 → 100644
View file @
696ff2ae
e25da3da50ed2396afe3bcb1ff441b5f1f0a43c0e23d66140a160d42f1b66a1a
\ No newline at end of file
db/structure.sql
View file @
696ff2ae
...
@@ -21764,8 +21764,6 @@ CREATE INDEX index_vulnerabilities_on_milestone_id ON vulnerabilities USING btre
...
@@ -21764,8 +21764,6 @@ CREATE INDEX index_vulnerabilities_on_milestone_id ON vulnerabilities USING btre
CREATE
INDEX
index_vulnerabilities_on_project_id
ON
vulnerabilities
USING
btree
(
project_id
);
CREATE
INDEX
index_vulnerabilities_on_project_id
ON
vulnerabilities
USING
btree
(
project_id
);
CREATE
INDEX
index_vulnerabilities_on_project_id_and_id
ON
vulnerabilities
USING
btree
(
project_id
,
id
);
CREATE
INDEX
index_vulnerabilities_on_resolved_by_id
ON
vulnerabilities
USING
btree
(
resolved_by_id
);
CREATE
INDEX
index_vulnerabilities_on_resolved_by_id
ON
vulnerabilities
USING
btree
(
resolved_by_id
);
CREATE
INDEX
index_vulnerabilities_on_start_date_sourcing_milestone_id
ON
vulnerabilities
USING
btree
(
start_date_sourcing_milestone_id
);
CREATE
INDEX
index_vulnerabilities_on_start_date_sourcing_milestone_id
ON
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