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
6333bc66
Commit
6333bc66
authored
Sep 17, 2020
by
Arturo Herrero
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update index on namespaces for type and id
Including the id column in the partial index improves performance.
parent
163ad707
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
1 deletion
+30
-1
changelogs/unreleased/209831-propagate-integrations-using-batching-and-queues.yml
...9831-propagate-integrations-using-batching-and-queues.yml
+5
-0
db/post_migrate/20200917165525_update_index_on_namespaces_for_type_and_id.rb
...00917165525_update_index_on_namespaces_for_type_and_id.rb
+23
-0
db/schema_migrations/20200917165525
db/schema_migrations/20200917165525
+1
-0
db/structure.sql
db/structure.sql
+1
-1
No files found.
changelogs/unreleased/209831-propagate-integrations-using-batching-and-queues.yml
0 → 100644
View file @
6333bc66
---
title
:
Update database index on namespaces for type and id
merge_request
:
42128
author
:
type
:
other
db/post_migrate/20200917165525_update_index_on_namespaces_for_type_and_id.rb
0 → 100644
View file @
6333bc66
# frozen_string_literal: true
class
UpdateIndexOnNamespacesForTypeAndId
<
ActiveRecord
::
Migration
[
6.0
]
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
disable_ddl_transaction!
OLD_INDEX_NAME
=
'index_namespaces_on_type_partial'
NEW_INDEX_NAME
=
'index_namespaces_on_type_and_id_partial'
def
up
add_concurrent_index
(
:namespaces
,
[
:type
,
:id
],
where:
'type IS NOT NULL'
,
name:
NEW_INDEX_NAME
)
remove_concurrent_index_by_name
(
:namespaces
,
OLD_INDEX_NAME
)
end
def
down
add_concurrent_index
(
:namespaces
,
:type
,
where:
'type IS NOT NULL'
,
name:
OLD_INDEX_NAME
)
remove_concurrent_index_by_name
(
:namespaces
,
NEW_INDEX_NAME
)
end
end
db/schema_migrations/20200917165525
0 → 100644
View file @
6333bc66
0080b9192ba5b4ea3853cfd930d58e10b9619f3d9a54016b574712e5ec2084f6
\ No newline at end of file
db/structure.sql
View file @
6333bc66
...
...
@@ -20596,7 +20596,7 @@ CREATE UNIQUE INDEX index_namespaces_on_runners_token_encrypted ON namespaces US
CREATE
INDEX
index_namespaces_on_shared_and_extra_runners_minutes_limit
ON
namespaces
USING
btree
(
shared_runners_minutes_limit
,
extra_shared_runners_minutes_limit
);
CREATE
INDEX
index_namespaces_on_type_
partial
ON
namespaces
USING
btree
(
type
)
WHERE
(
type
IS
NOT
NULL
);
CREATE
INDEX
index_namespaces_on_type_
and_id_partial
ON
namespaces
USING
btree
(
type
,
id
)
WHERE
(
type
IS
NOT
NULL
);
CREATE
INDEX
index_non_requested_project_members_on_source_id_and_type
ON
members
USING
btree
(
source_id
,
source_type
)
WHERE
((
requested_at
IS
NULL
)
AND
((
type
)::
text
=
'ProjectMember'
::
text
));
...
...
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