From 2653d8ca9e7d0484e33af027efe20f6899dfbb11 Mon Sep 17 00:00:00 2001 From: Ian Ballou Date: Mon, 16 Oct 2023 12:47:58 +0000 Subject: [PATCH] Fixes #36835 - host applicable errata filter too slow --- app/models/katello/erratum.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/katello/erratum.rb b/app/models/katello/erratum.rb index bc7bd3308e2..e9bf066f588 100644 --- a/app/models/katello/erratum.rb +++ b/app/models/katello/erratum.rb @@ -71,7 +71,7 @@ def self.applicable_to_hosts(hosts) # It is not the errata "belonging" to the host. Its rather the errata that is "applicable" # which is calculated elsewhere. - self.joins(:content_facets). + self.group(:id).distinct.joins(:content_facets). where("#{Katello::Host::ContentFacet.table_name}.host_id" => hosts.select(:id)) end