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
8d942cb1
Commit
8d942cb1
authored
Dec 07, 2021
by
huzaifaiftikhar1
Committed by
Huzaifa Iftikhar
Dec 07, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace marked_for_deletion_at column with id to get index only scan
parent
b90bc5ad
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
db/post_migrate/20211203091642_add_index_to_projects_on_marked_for_deletion_at.rb
...091642_add_index_to_projects_on_marked_for_deletion_at.rb
+2
-2
db/structure.sql
db/structure.sql
+1
-1
No files found.
db/post_migrate/20211203091642_add_index_to_projects_on_marked_for_deletion_at.rb
View file @
8d942cb1
...
...
@@ -6,10 +6,10 @@ class AddIndexToProjectsOnMarkedForDeletionAt < Gitlab::Database::Migration[1.0]
INDEX_NAME
=
'index_projects_not_aimed_for_deletion'
def
up
add_concurrent_index
:projects
,
:
marked_for_deletion_at
,
where:
'marked_for_deletion_at IS NULL'
,
name:
INDEX_NAME
add_concurrent_index
:projects
,
:
id
,
where:
'marked_for_deletion_at IS NULL'
,
name:
INDEX_NAME
end
def
down
remove_concurrent_index
:projects
,
:
marked_for_deletion_at
,
name:
INDEX_NAME
remove_concurrent_index
:projects
,
:
id
,
name:
INDEX_NAME
end
end
db/structure.sql
View file @
8d942cb1
...
...
@@ -27108,7 +27108,7 @@ CREATE INDEX index_projects_api_vis20_path ON projects USING btree (path, id) WH
CREATE INDEX index_projects_api_vis20_updated_at ON projects USING btree (updated_at, id) WHERE (visibility_level = 20);
CREATE INDEX index_projects_not_aimed_for_deletion ON projects USING btree (
marked_for_deletion_at
) WHERE (marked_for_deletion_at IS NULL);
CREATE INDEX index_projects_not_aimed_for_deletion ON projects USING btree (
id
) WHERE (marked_for_deletion_at IS NULL);
CREATE INDEX index_projects_on_created_at_and_id ON projects USING btree (created_at, 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