diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-02-18 12:45:46 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-02-18 12:45:46 +0300 |
commit | a7b3560714b4d9cc4ab32dffcd1f74a284b93580 (patch) | |
tree | 7452bd5c3545c2fa67a28aa013835fb4fa071baf /doc/development/database/efficient_in_operator_queries.md | |
parent | ee9173579ae56a3dbfe5afe9f9410c65bb327ca7 (diff) |
Add latest changes from gitlab-org/gitlab@14-8-stable-eev14.8.0-rc42
Diffstat (limited to 'doc/development/database/efficient_in_operator_queries.md')
-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 |