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
125215f2
Commit
125215f2
authored
Jul 16, 2018
by
Valery Sizov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve projects indexes
parent
2c5e6b27
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
0 deletions
+29
-0
changelogs/unreleased/4525-fix-project-indexes.yml
changelogs/unreleased/4525-fix-project-indexes.yml
+5
-0
db/post_migrate/20180704145007_update_project_indexes.rb
db/post_migrate/20180704145007_update_project_indexes.rb
+23
-0
db/schema.rb
db/schema.rb
+1
-0
No files found.
changelogs/unreleased/4525-fix-project-indexes.yml
0 → 100644
View file @
125215f2
---
title
:
Rework some projects table indexes around repository_storage field
merge_request
:
20377
author
:
type
:
fixed
db/post_migrate/20180704145007_update_project_indexes.rb
0 → 100644
View file @
125215f2
# See http://doc.gitlab.com/ce/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.
class
UpdateProjectIndexes
<
ActiveRecord
::
Migration
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
NEW_INDEX_NAME
=
'idx_project_repository_check_partial'
disable_ddl_transaction!
def
up
add_concurrent_index
(
:projects
,
[
:repository_storage
,
:created_at
],
name:
NEW_INDEX_NAME
,
where:
'last_repository_check_at IS NULL'
)
end
def
down
remove_concurrent_index_by_name
(
:projects
,
NEW_INDEX_NAME
)
end
end
db/schema.rb
View file @
125215f2
...
@@ -1674,6 +1674,7 @@ ActiveRecord::Schema.define(version: 20180704204006) do
...
@@ -1674,6 +1674,7 @@ ActiveRecord::Schema.define(version: 20180704204006) do
add_index
"projects"
,
[
"path"
],
name:
"index_projects_on_path"
,
using: :btree
add_index
"projects"
,
[
"path"
],
name:
"index_projects_on_path"
,
using: :btree
add_index
"projects"
,
[
"path"
],
name:
"index_projects_on_path_trigram"
,
using: :gin
,
opclasses:
{
"path"
=>
"gin_trgm_ops"
}
add_index
"projects"
,
[
"path"
],
name:
"index_projects_on_path_trigram"
,
using: :gin
,
opclasses:
{
"path"
=>
"gin_trgm_ops"
}
add_index
"projects"
,
[
"pending_delete"
],
name:
"index_projects_on_pending_delete"
,
using: :btree
add_index
"projects"
,
[
"pending_delete"
],
name:
"index_projects_on_pending_delete"
,
using: :btree
add_index
"projects"
,
[
"repository_storage"
,
"created_at"
],
name:
"idx_project_repository_check_partial"
,
where:
"(last_repository_check_at IS NULL)"
,
using: :btree
add_index
"projects"
,
[
"repository_storage"
],
name:
"index_projects_on_repository_storage"
,
using: :btree
add_index
"projects"
,
[
"repository_storage"
],
name:
"index_projects_on_repository_storage"
,
using: :btree
add_index
"projects"
,
[
"runners_token"
],
name:
"index_projects_on_runners_token"
,
using: :btree
add_index
"projects"
,
[
"runners_token"
],
name:
"index_projects_on_runners_token"
,
using: :btree
add_index
"projects"
,
[
"star_count"
],
name:
"index_projects_on_star_count"
,
using: :btree
add_index
"projects"
,
[
"star_count"
],
name:
"index_projects_on_star_count"
,
using: :btree
...
...
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