diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-26 12:14:20 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-26 12:14:20 +0300 |
commit | 30b1000678f33e5b8ae5b4dcbeb2ae5162a2cc5d (patch) | |
tree | 2929d8692104f816194e7462e21bcda2c91ed10e /doc/development/database | |
parent | 4b198b6289b1643b6e2571c03a377fe08e6ab504 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'doc/development/database')
-rw-r--r-- | doc/development/database/efficient_in_operator_queries.md | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/doc/development/database/efficient_in_operator_queries.md b/doc/development/database/efficient_in_operator_queries.md index 76518a6f5e2..2503be826ea 100644 --- a/doc/development/database/efficient_in_operator_queries.md +++ b/doc/development/database/efficient_in_operator_queries.md @@ -368,7 +368,7 @@ then the query might perform worse than the non-optimized query. The `milestone_ "index_issues_on_milestone_id" btree (milestone_id) ``` -Adding the `miletone_id = X` filter to the `scope` argument or to the optimized scope causes bad performance. +Adding the `milestone_id = X` filter to the `scope` argument or to the optimized scope causes bad performance. Example (bad): @@ -618,7 +618,7 @@ The following example shows the final `ORDER BY` clause: ORDER BY extract('epoch' FROM epics.closed_at - epics.created_at) DESC, epics.id DESC ``` -Snippet for loading records ordered by the calcualted duration: +Snippet for loading records ordered by the calculated duration: ```ruby arel_table = Epic.arel_table @@ -641,7 +641,7 @@ records = Gitlab::Pagination::Keyset::InOperatorOptimization::QueryBuilder.new( array_mapping_scope: -> (id_expression) { Epic.where(Epic.arel_table[:group_id].eq(id_expression)) } ).execute.limit(20) -puts records.pluck(:duration_in_seconds, :id) # other columnns are not available +puts records.pluck(:duration_in_seconds, :id) # other columns are not available ``` Building the query requires quite a bit of configuration. For the order configuration you |