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
405da4f5
Commit
405da4f5
authored
Sep 10, 2019
by
Andreas Brandl
Committed by
Toon Claes
Sep 12, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Partial index for namespaces.type
Relates to
https://gitlab.com/gitlab-org/gitlab-ce/issues/66956
parent
61abf926
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
1 deletion
+26
-1
changelogs/unreleased/ab-partial-index-for-namespaces-type.yml
...elogs/unreleased/ab-partial-index-for-namespaces-type.yml
+5
-0
db/migrate/20190910114843_exclude_nulls_from_index_on_namespaces_type.rb
...0910114843_exclude_nulls_from_index_on_namespaces_type.rb
+20
-0
db/schema.rb
db/schema.rb
+1
-1
No files found.
changelogs/unreleased/ab-partial-index-for-namespaces-type.yml
0 → 100644
View file @
405da4f5
---
title
:
Partial index for namespaces.type
merge_request
:
32876
author
:
type
:
performance
db/migrate/20190910114843_exclude_nulls_from_index_on_namespaces_type.rb
0 → 100644
View file @
405da4f5
# frozen_string_literal: true
class
ExcludeNullsFromIndexOnNamespacesType
<
ActiveRecord
::
Migration
[
5.1
]
include
Gitlab
::
Database
::
MigrationHelpers
# Set this constant to true if this migration requires downtime.
DOWNTIME
=
false
disable_ddl_transaction!
def
up
add_concurrent_index
(
:namespaces
,
:type
,
where:
'type is not null'
,
name:
'index_namespaces_on_type_partial'
)
remove_concurrent_index_by_name
(
:namespaces
,
'index_namespaces_on_type'
)
end
def
down
add_concurrent_index
(
:namespaces
,
:type
,
name:
'index_namespaces_on_type'
)
remove_concurrent_index_by_name
(
:namespaces
,
'index_namespaces_on_type_partial'
)
end
end
db/schema.rb
View file @
405da4f5
...
...
@@ -2291,7 +2291,7 @@ ActiveRecord::Schema.define(version: 2019_09_12_061145) do
t
.
index
[
"runners_token_encrypted"
],
name:
"index_namespaces_on_runners_token_encrypted"
,
unique:
true
t
.
index
[
"shared_runners_minutes_limit"
,
"extra_shared_runners_minutes_limit"
],
name:
"index_namespaces_on_shared_and_extra_runners_minutes_limit"
t
.
index
[
"trial_ends_on"
],
name:
"index_namespaces_on_trial_ends_on"
,
where:
"(trial_ends_on IS NOT NULL)"
t
.
index
[
"type"
],
name:
"index_namespaces_on_type"
t
.
index
[
"type"
],
name:
"index_namespaces_on_type
_partial"
,
where:
"(type IS NOT NULL)
"
end
create_table
"note_diff_files"
,
id: :serial
,
force: :cascade
do
|
t
|
...
...
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