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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
850e327c
Commit
850e327c
authored
Sep 12, 2017
by
Alexis Reigel
Committed by
Alexis Reigel
Apr 23, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use INNER JOIN instead of LEFT JOIN
as we're using UNION now we can use INNER JOIN.
parent
b55c3a7b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
13 deletions
+4
-13
app/models/ci/runner.rb
app/models/ci/runner.rb
+4
-13
No files found.
app/models/ci/runner.rb
View file @
850e327c
...
...
@@ -29,22 +29,13 @@ module Ci
scope
:ordered
,
->
()
{
order
(
id: :desc
)
}
scope
:owned_or_shared
,
->
(
project_id
)
do
project_runners
=
joins
(
%{
LEFT JOIN ci_runner_projects ON ci_runner_projects.runner_id = ci_runners.id
}
).
where
(
%{
ci_runner_projects.project_id = :project_id
}
,
project_id:
project_id
)
project_runners
=
joins
(
:runner_projects
).
where
(
ci_runner_projects:
{
project_id:
project_id
})
group_runners
=
joins
(
%{
LEFT
JOIN ci_runner_groups ON ci_runner_groups.runner_id = ci_runners.id
LEFT
JOIN namespaces ON namespaces.id = ci_runner_groups.group_id
LEFT
JOIN projects group_projects ON group_projects.namespace_id = namespaces.id
INNER
JOIN ci_runner_groups ON ci_runner_groups.runner_id = ci_runners.id
INNER
JOIN namespaces ON namespaces.id = ci_runner_groups.group_id
INNER
JOIN projects group_projects ON group_projects.namespace_id = namespaces.id
}
).
where
(
%{
...
...
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