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
f92fcf60
Commit
f92fcf60
authored
Mar 11, 2020
by
Felipe Artur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Index issues on sent_notifications
Add index to sent_notifications table to prevent statement timeouts
parent
77885f3a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
0 deletions
+27
-0
changelogs/unreleased/issue_11391_2.yml
changelogs/unreleased/issue_11391_2.yml
+5
-0
db/post_migrate/20200311192351_add_index_on_noteable_type_and_noteable_id_to_sent_notifications.rb
...on_noteable_type_and_noteable_id_to_sent_notifications.rb
+21
-0
db/schema.rb
db/schema.rb
+1
-0
No files found.
changelogs/unreleased/issue_11391_2.yml
0 → 100644
View file @
f92fcf60
---
title
:
Index issues on sent_notifications table
merge_request
:
27034
author
:
type
:
performance
db/post_migrate/20200311192351_add_index_on_noteable_type_and_noteable_id_to_sent_notifications.rb
0 → 100644
View file @
f92fcf60
# frozen_string_literal: true
class
AddIndexOnNoteableTypeAndNoteableIdToSentNotifications
<
ActiveRecord
::
Migration
[
6.0
]
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
INDEX_NAME
=
'index_sent_notifications_on_noteable_type_noteable_id'
disable_ddl_transaction!
def
up
add_concurrent_index
:sent_notifications
,
[
:noteable_id
],
name:
INDEX_NAME
,
where:
"noteable_type = 'Issue'"
end
def
down
remove_concurrent_index_by_name
:sent_notifications
,
INDEX_NAME
end
end
db/schema.rb
View file @
f92fcf60
...
...
@@ -3919,6 +3919,7 @@ ActiveRecord::Schema.define(version: 2020_03_13_123934) do
t
.
string
"note_type"
t
.
text
"position"
t
.
string
"in_reply_to_discussion_id"
t
.
index
[
"noteable_id"
],
name:
"index_sent_notifications_on_noteable_type_noteable_id"
,
where:
"((noteable_type)::text = 'Issue'::text)"
t
.
index
[
"reply_key"
],
name:
"index_sent_notifications_on_reply_key"
,
unique:
true
end
...
...
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