Skip to content

Commit

Permalink
Use DISTINCT instead of DINSTINCT ON for /v3/service_instances (#4210)
Browse files Browse the repository at this point in the history
On large foundations using PostgreSQL DISTINCT ON might lead to wrong
query plans making the resulting execution very slow.
  • Loading branch information
philippthun authored Feb 7, 2025
1 parent f501372 commit 5b1af26
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/fetchers/service_instance_list_fetcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def fetch(message, omniscient: false, readable_spaces_dataset: nil, eager_loaded

filter(dataset, message).
select_all(:service_instances).
distinct(:service_instances__id)
distinct
end

private
Expand Down

0 comments on commit 5b1af26

Please sign in to comment.