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
46484c6d
Commit
46484c6d
authored
Jul 10, 2020
by
Sean Arnold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add concurrent indexes
- Remove unnecessary cast
parent
77197d68
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
9 deletions
+7
-9
db/migrate/20200706035141_adjust_unique_index_alert_management_alerts.rb
...0706035141_adjust_unique_index_alert_management_alerts.rb
+6
-8
db/structure.sql
db/structure.sql
+1
-1
No files found.
db/migrate/20200706035141_adjust_unique_index_alert_management_alerts.rb
View file @
46484c6d
...
@@ -8,11 +8,11 @@ class AdjustUniqueIndexAlertManagementAlerts < ActiveRecord::Migration[6.0]
...
@@ -8,11 +8,11 @@ class AdjustUniqueIndexAlertManagementAlerts < ActiveRecord::Migration[6.0]
NEW_INDEX_NAME
=
'index_partial_am_alerts_on_project_id_and_fingerprint'
NEW_INDEX_NAME
=
'index_partial_am_alerts_on_project_id_and_fingerprint'
RESOLVED_STATUS
=
2
RESOLVED_STATUS
=
2
# rubocop:disable Migration/RemoveIndex
disable_ddl_transaction!
# rubocop:disable Migration/AddIndex
def
up
def
up
add_
index
(
:alert_management_alerts
,
%w(project_id fingerprint)
,
where:
"status <> '
#{
RESOLVED_STATUS
}
'
"
,
name:
NEW_INDEX_NAME
,
unique:
true
,
using: :btree
)
add_
concurrent_index
(
:alert_management_alerts
,
%w(project_id fingerprint)
,
where:
"status <>
#{
RESOLVED_STATUS
}
"
,
name:
NEW_INDEX_NAME
,
unique:
true
,
using: :btree
)
remove_
index
:alert_management_alerts
,
name:
INDEX_NAME
remove_
concurrent_index_by_name
:alert_management_alerts
,
INDEX_NAME
end
end
def
down
def
down
...
@@ -29,9 +29,7 @@ class AdjustUniqueIndexAlertManagementAlerts < ActiveRecord::Migration[6.0]
...
@@ -29,9 +29,7 @@ class AdjustUniqueIndexAlertManagementAlerts < ActiveRecord::Migration[6.0]
execute
(
query
)
execute
(
query
)
remove_
index
:alert_management_alerts
,
name:
NEW_INDEX_NAME
remove_
concurrent_index_by_name
:alert_management_alerts
,
NEW_INDEX_NAME
add_index
(
:alert_management_alerts
,
%w(project_id fingerprint)
,
name:
INDEX_NAME
,
unique:
true
,
using: :btree
)
add_
concurrent_
index
(
:alert_management_alerts
,
%w(project_id fingerprint)
,
name:
INDEX_NAME
,
unique:
true
,
using: :btree
)
end
end
# rubocop:enable Migration/RemoveIndex
# rubocop:enable Migration/AddIndex
end
end
db/structure.sql
View file @
46484c6d
...
@@ -19943,7 +19943,7 @@ CREATE INDEX index_pages_domains_on_verified_at_and_enabled_until ON public.page
...
@@ -19943,7 +19943,7 @@ CREATE INDEX index_pages_domains_on_verified_at_and_enabled_until ON public.page
CREATE
INDEX
index_pages_domains_on_wildcard
ON
public
.
pages_domains
USING
btree
(
wildcard
);
CREATE
INDEX
index_pages_domains_on_wildcard
ON
public
.
pages_domains
USING
btree
(
wildcard
);
CREATE
UNIQUE
INDEX
index_partial_am_alerts_on_project_id_and_fingerprint
ON
public
.
alert_management_alerts
USING
btree
(
project_id
,
fingerprint
)
WHERE
(
status
<>
'2'
::
smallint
);
CREATE
UNIQUE
INDEX
index_partial_am_alerts_on_project_id_and_fingerprint
ON
public
.
alert_management_alerts
USING
btree
(
project_id
,
fingerprint
)
WHERE
(
status
<>
2
);
CREATE
UNIQUE
INDEX
index_partitioned_foreign_keys_unique_index
ON
public
.
partitioned_foreign_keys
USING
btree
(
to_table
,
from_table
,
from_column
);
CREATE
UNIQUE
INDEX
index_partitioned_foreign_keys_unique_index
ON
public
.
partitioned_foreign_keys
USING
btree
(
to_table
,
from_table
,
from_column
);
...
...
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