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
90ba60f0
Commit
90ba60f0
authored
Feb 02, 2021
by
Sarah Yasonik
Committed by
Patrick Bair
Feb 02, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add index on starts_at/ends_at for oncall shifts
parent
2a62b9da
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
2 deletions
+32
-2
changelogs/unreleased/sy-add-shift-timeframe-index.yml
changelogs/unreleased/sy-add-shift-timeframe-index.yml
+5
-0
db/migrate/20210129225244_add_index_to_oncall_shfts_on_starts_at_and_ends_at.rb
...244_add_index_to_oncall_shfts_on_starts_at_and_ends_at.rb
+24
-0
db/schema_migrations/20210129225244
db/schema_migrations/20210129225244
+1
-0
db/structure.sql
db/structure.sql
+2
-2
No files found.
changelogs/unreleased/sy-add-shift-timeframe-index.yml
0 → 100644
View file @
90ba60f0
---
title
:
Add index to incident management oncall shifts table
merge_request
:
52961
author
:
type
:
performance
db/migrate/20210129225244_add_index_to_oncall_shfts_on_starts_at_and_ends_at.rb
0 → 100644
View file @
90ba60f0
# frozen_string_literal: true
class
AddIndexToOncallShftsOnStartsAtAndEndsAt
<
ActiveRecord
::
Migration
[
6.0
]
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
disable_ddl_transaction!
NEW_NAME
=
'index_oncall_shifts_on_rotation_id_and_starts_at_and_ends_at'
OLD_NAME
=
'index_incident_management_oncall_shifts_on_rotation_id'
def
up
add_concurrent_index
:incident_management_oncall_shifts
,
%i[rotation_id starts_at ends_at]
,
name:
NEW_NAME
remove_concurrent_index_by_name
:incident_management_oncall_shifts
,
OLD_NAME
end
def
down
add_concurrent_index
:incident_management_oncall_shifts
,
:rotation_id
,
name:
OLD_NAME
remove_concurrent_index_by_name
:incident_management_oncall_shifts
,
NEW_NAME
end
end
db/schema_migrations/20210129225244
0 → 100644
View file @
90ba60f0
6cb54c71a9835ec1b3cf801a19c2cd385d224e0438c7924b6a29d298ecebe8a7
\ No newline at end of file
db/structure.sql
View file @
90ba60f0
...
...
@@ -22130,8 +22130,6 @@ CREATE INDEX index_incident_management_oncall_schedules_on_project_id ON inciden
CREATE
INDEX
index_incident_management_oncall_shifts_on_participant_id
ON
incident_management_oncall_shifts
USING
btree
(
participant_id
);
CREATE
INDEX
index_incident_management_oncall_shifts_on_rotation_id
ON
incident_management_oncall_shifts
USING
btree
(
rotation_id
);
CREATE
UNIQUE
INDEX
index_index_statuses_on_project_id
ON
index_statuses
USING
btree
(
project_id
);
CREATE
INDEX
index_insights_on_namespace_id
ON
insights
USING
btree
(
namespace_id
);
...
...
@@ -22578,6 +22576,8 @@ CREATE INDEX index_onboarding_progresses_for_verify_track ON onboarding_progress
CREATE
UNIQUE
INDEX
index_onboarding_progresses_on_namespace_id
ON
onboarding_progresses
USING
btree
(
namespace_id
);
CREATE
INDEX
index_oncall_shifts_on_rotation_id_and_starts_at_and_ends_at
ON
incident_management_oncall_shifts
USING
btree
(
rotation_id
,
starts_at
,
ends_at
);
CREATE
INDEX
index_open_project_tracker_data_on_service_id
ON
open_project_tracker_data
USING
btree
(
service_id
);
CREATE
INDEX
index_operations_feature_flags_issues_on_issue_id
ON
operations_feature_flags_issues
USING
btree
(
issue_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