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
2b6d448f
Commit
2b6d448f
authored
May 06, 2021
by
Alex Pooley
Committed by
Adam Hegyi
May 06, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Resolve "Inverse index on namespaces parent_id, id"
parent
a961e951
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
0 deletions
+26
-0
changelogs/unreleased/330086-inverse-index-on-namespaces-parent_id-id.yml
...eased/330086-inverse-index-on-namespaces-parent_id-id.yml
+5
-0
db/post_migrate/20210506064413_create_namespaces_id_parent_id_inverse_partial_index.rb
...3_create_namespaces_id_parent_id_inverse_partial_index.rb
+18
-0
db/schema_migrations/20210506064413
db/schema_migrations/20210506064413
+1
-0
db/structure.sql
db/structure.sql
+2
-0
No files found.
changelogs/unreleased/330086-inverse-index-on-namespaces-parent_id-id.yml
0 → 100644
View file @
2b6d448f
---
title
:
Partial index optimization for namespaces id
merge_request
:
61098
author
:
type
:
performance
db/post_migrate/20210506064413_create_namespaces_id_parent_id_inverse_partial_index.rb
0 → 100644
View file @
2b6d448f
# frozen_string_literal: true
class
CreateNamespacesIdParentIdInversePartialIndex
<
ActiveRecord
::
Migration
[
6.0
]
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
NAME
=
'index_namespaces_id_parent_id_is_not_null'
disable_ddl_transaction!
def
up
add_concurrent_index
:namespaces
,
:id
,
where:
'parent_id IS NOT NULL'
,
name:
NAME
end
def
down
remove_concurrent_index
:namespaces
,
:id
,
name:
NAME
end
end
db/schema_migrations/20210506064413
0 → 100644
View file @
2b6d448f
f400225e6caa854f825422b9799e61ea557ab4bd3e4a33dc3cd3193ed3ce1db2
\ No newline at end of file
db/structure.sql
View file @
2b6d448f
...
...
@@ -23454,6 +23454,8 @@ CREATE UNIQUE INDEX index_namespace_root_storage_statistics_on_namespace_id ON n
CREATE UNIQUE INDEX index_namespace_statistics_on_namespace_id ON namespace_statistics USING btree (namespace_id);
CREATE INDEX index_namespaces_id_parent_id_is_not_null ON namespaces USING btree (id) WHERE (parent_id IS NOT NULL);
CREATE INDEX index_namespaces_id_parent_id_is_null ON namespaces USING btree (id) WHERE (parent_id IS NULL);
CREATE INDEX index_namespaces_on_created_at ON namespaces USING btree (created_at);
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