BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
35597a4c
Commit
35597a4c
authored
May 29, 2018
by
Douwe Maan
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'groups-controller-show-performance' into 'master'
Improve performance of GroupsController#show See merge request gitlab-org/gitlab-ce!18973
parents
aaa98c73
50555a9b
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
36 additions
and
12 deletions
+36
-12
group_projects_finder.rb
app/finders/group_projects_finder.rb
+0
-10
groups-controller-show-performance.yml
changelogs/unreleased/groups-controller-show-performance.yml
+5
-0
20180524132016_merge_requests_target_id_iid_state_partial_index.rb
...32016_merge_requests_target_id_iid_state_partial_index.rb
+27
-0
schema.rb
db/schema.rb
+2
-1
issue_parser.rb
lib/banzai/reference_parser/issue_parser.rb
+2
-1
No files found.
app/finders/group_projects_finder.rb
View file @
35597a4c
...
@@ -39,15 +39,6 @@ class GroupProjectsFinder < ProjectsFinder
...
@@ -39,15 +39,6 @@ class GroupProjectsFinder < ProjectsFinder
end
end
def
collection_with_user
def
collection_with_user
if
group
.
users
.
include?
(
current_user
)
if
only_shared?
[
shared_projects
]
elsif
only_owned?
[
owned_projects
]
else
[
shared_projects
,
owned_projects
]
end
else
if
only_shared?
if
only_shared?
[
shared_projects
.
public_or_visible_to_user
(
current_user
)]
[
shared_projects
.
public_or_visible_to_user
(
current_user
)]
elsif
only_owned?
elsif
only_owned?
...
@@ -59,7 +50,6 @@ class GroupProjectsFinder < ProjectsFinder
...
@@ -59,7 +50,6 @@ class GroupProjectsFinder < ProjectsFinder
]
]
end
end
end
end
end
def
collection_without_user
def
collection_without_user
if
only_shared?
if
only_shared?
...
...
changelogs/unreleased/groups-controller-show-performance.yml
0 → 100644
View file @
35597a4c
---
title
:
Improve performance of GroupsController#show
merge_request
:
author
:
type
:
performance
db/migrate/20180524132016_merge_requests_target_id_iid_state_partial_index.rb
0 → 100644
View file @
35597a4c
# See http://doc.gitlab.com/ce/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.
class
MergeRequestsTargetIdIidStatePartialIndex
<
ActiveRecord
::
Migration
include
Gitlab
::
Database
::
MigrationHelpers
# Set this constant to true if this migration requires downtime.
DOWNTIME
=
false
INDEX_NAME
=
'index_merge_requests_on_target_project_id_and_iid_opened'
disable_ddl_transaction!
def
up
# On GitLab.com this index will take up roughly 5 MB of space.
add_concurrent_index
(
:merge_requests
,
[
:target_project_id
,
:iid
],
where:
"state = 'opened'"
,
name:
INDEX_NAME
)
end
def
down
remove_concurrent_index_by_name
(
:merge_requests
,
INDEX_NAME
)
end
end
db/schema.rb
View file @
35597a4c
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
#
#
# It's strongly recommended that you check this file into your version control system.
# It's strongly recommended that you check this file into your version control system.
ActiveRecord
::
Schema
.
define
(
version:
2018052
1171529
)
do
ActiveRecord
::
Schema
.
define
(
version:
2018052
4132016
)
do
# These are extensions that must be enabled in order to support this database
# These are extensions that must be enabled in order to support this database
enable_extension
"plpgsql"
enable_extension
"plpgsql"
...
@@ -1232,6 +1232,7 @@ ActiveRecord::Schema.define(version: 20180521171529) do
...
@@ -1232,6 +1232,7 @@ ActiveRecord::Schema.define(version: 20180521171529) do
add_index
"merge_requests"
,
[
"source_project_id"
,
"source_branch"
],
name:
"index_merge_requests_on_source_project_id_and_source_branch"
,
using: :btree
add_index
"merge_requests"
,
[
"source_project_id"
,
"source_branch"
],
name:
"index_merge_requests_on_source_project_id_and_source_branch"
,
using: :btree
add_index
"merge_requests"
,
[
"target_branch"
],
name:
"index_merge_requests_on_target_branch"
,
using: :btree
add_index
"merge_requests"
,
[
"target_branch"
],
name:
"index_merge_requests_on_target_branch"
,
using: :btree
add_index
"merge_requests"
,
[
"target_project_id"
,
"iid"
],
name:
"index_merge_requests_on_target_project_id_and_iid"
,
unique:
true
,
using: :btree
add_index
"merge_requests"
,
[
"target_project_id"
,
"iid"
],
name:
"index_merge_requests_on_target_project_id_and_iid"
,
unique:
true
,
using: :btree
add_index
"merge_requests"
,
[
"target_project_id"
,
"iid"
],
name:
"index_merge_requests_on_target_project_id_and_iid_opened"
,
where:
"((state)::text = 'opened'::text)"
,
using: :btree
add_index
"merge_requests"
,
[
"target_project_id"
,
"merge_commit_sha"
,
"id"
],
name:
"index_merge_requests_on_tp_id_and_merge_commit_sha_and_id"
,
using: :btree
add_index
"merge_requests"
,
[
"target_project_id"
,
"merge_commit_sha"
,
"id"
],
name:
"index_merge_requests_on_tp_id_and_merge_commit_sha_and_id"
,
using: :btree
add_index
"merge_requests"
,
[
"title"
],
name:
"index_merge_requests_on_title"
,
using: :btree
add_index
"merge_requests"
,
[
"title"
],
name:
"index_merge_requests_on_title"
,
using: :btree
add_index
"merge_requests"
,
[
"title"
],
name:
"index_merge_requests_on_title_trigram"
,
using: :gin
,
opclasses:
{
"title"
=>
"gin_trgm_ops"
}
add_index
"merge_requests"
,
[
"title"
],
name:
"index_merge_requests_on_title_trigram"
,
using: :gin
,
opclasses:
{
"title"
=>
"gin_trgm_ops"
}
...
...
lib/banzai/reference_parser/issue_parser.rb
View file @
35597a4c
...
@@ -69,7 +69,8 @@ module Banzai
...
@@ -69,7 +69,8 @@ module Banzai
{
group:
[
:owners
,
:group_members
]
},
{
group:
[
:owners
,
:group_members
]
},
:invited_groups
,
:invited_groups
,
:project_members
,
:project_members
,
:project_feature
:project_feature
,
:route
]
]
}
}
),
),
...
...
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