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
80057bed
Commit
80057bed
authored
Oct 27, 2020
by
Mario de la Ossa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use pg_hint_plan for IssuableFinder
parent
99563cee
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
0 deletions
+20
-0
app/finders/issuable_finder.rb
app/finders/issuable_finder.rb
+9
-0
config/feature_flags/development/pg_hint_plan_for_issuables.yml
.../feature_flags/development/pg_hint_plan_for_issuables.yml
+7
-0
spec/finders/issues_finder_spec.rb
spec/finders/issues_finder_spec.rb
+4
-0
No files found.
app/finders/issuable_finder.rb
View file @
80057bed
...
...
@@ -341,6 +341,15 @@ class IssuableFinder
cte
<<
items
items
=
klass
.
with
(
cte
.
to_arel
).
from
(
klass
.
table_name
)
elsif
Feature
.
enabled?
(
:pg_hint_plan_for_issuables
,
params
.
project
)
items
=
items
.
optimizer_hints
(
<<~
HINTS
)
BitmapScan(
issues idx_issues_on_project_id_and_created_at_and_id_and_state_id
idx_issues_on_project_id_and_due_date_and_id_and_state_id
idx_issues_on_project_id_and_updated_at_and_id_and_state_id
index_issues_on_project_id_and_iid
)
HINTS
end
items
.
full_search
(
search
,
matched_columns:
params
[
:in
],
use_minimum_char_limit:
!
use_cte_for_search?
)
...
...
config/feature_flags/development/pg_hint_plan_for_issuables.yml
0 → 100644
View file @
80057bed
---
name
:
pg_hint_plan_for_issuables
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/46289
rollout_issue_url
:
https://gitlab.com/gitlab-org/gitlab/-/issues/273528
type
:
development
group
:
group::project planning
default_enabled
:
false
spec/finders/issues_finder_spec.rb
View file @
80057bed
...
...
@@ -472,6 +472,10 @@ RSpec.describe IssuesFinder do
it
'returns issues with title and description match for search term'
do
expect
(
issues
).
to
contain_exactly
(
issue1
,
issue2
)
end
it
'uses optimizer hints'
do
expect
(
issues
.
to_sql
).
to
match
(
/BitmapScan/
)
end
end
context
'filtering by issue term in title'
do
...
...
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