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
042b7175
Commit
042b7175
authored
Sep 14, 2021
by
Adam Hegyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix IN operator optimization docs
Fix IN operator optimization docs.
parent
97b7e052
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
doc/development/database/efficient_in_operator_queries.md
doc/development/database/efficient_in_operator_queries.md
+4
-3
No files found.
doc/development/database/efficient_in_operator_queries.md
View file @
042b7175
...
@@ -463,7 +463,7 @@ Gitlab::Pagination::Keyset::InOperatorOptimization::QueryBuilder.new(
...
@@ -463,7 +463,7 @@ Gitlab::Pagination::Keyset::InOperatorOptimization::QueryBuilder.new(
<details>
<details>
<summary>
Expand this sentence to see the SQL query.
</summary>
<summary>
Expand this sentence to see the SQL query.
</summary>
<pre><code
lang=
'sql'
>
<pre><code>
SELECT "issues".
*
SELECT "issues".
*
FROM
FROM
(WITH RECURSIVE "array_cte" AS MATERIALIZED
(WITH RECURSIVE "array_cte" AS MATERIALIZED
...
@@ -582,6 +582,7 @@ FROM
...
@@ -582,6 +582,7 @@ FROM
WHERE (COUNT
<>
0)) issues
WHERE (COUNT
<>
0)) issues
LIMIT 20
LIMIT 20
</code>
</code>
</pre>
</details>
</details>
NOTE:
NOTE:
...
@@ -613,7 +614,7 @@ end
...
@@ -613,7 +614,7 @@ end
#### Keyset pagination
#### Keyset pagination
The optimization works out of the box with GraphQL and the
`keyset_paginate`
helper method.
The optimization works out of the box with GraphQL and the
`keyset_paginate`
helper method.
Read more about
[
keyset pagination
](
database/
keyset_pagination.md
)
.
Read more about
[
keyset pagination
](
keyset_pagination.md
)
.
```
ruby
```
ruby
array_scope
=
Group
.
find
(
9970
).
all_projects
.
select
(
:id
)
array_scope
=
Group
.
find
(
9970
).
all_projects
.
select
(
:id
)
...
@@ -637,7 +638,7 @@ issues = Issue
...
@@ -637,7 +638,7 @@ issues = Issue
#### Offset pagination with Kaminari
#### Offset pagination with Kaminari
The
`ActiveRecord`
scope produced by the
`InOperatorOptimization`
class can be used in
The
`ActiveRecord`
scope produced by the
`InOperatorOptimization`
class can be used in
[
offset-paginated
](
database/
pagination_guidelines.md#offset-pagination
)
[
offset-paginated
](
pagination_guidelines.md#offset-pagination
)
queries.
queries.
```
ruby
```
ruby
...
...
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