Actions
Bug #23270
closedslow query when updating content facet applicability counts
Description
When there are a lot of hosts and a lot of rpms, this query can be slow:
SELECT COUNT(*) FROM "katello_rpms" INNER JOIN "katello_content_facet_applicable_rpms" ON "katello_rpms"."id" = "katello_content_facet_appl
icable_rpms"."rpm_id" WHERE "katello_content_facet_applicable_rpms"."content_facet_id" = $1 [["content_facet_id", 51438]]
it is generated by:
def update_applicability_counts
self.update_attributes!(
:installable_security_errata_count => self.installable_errata.security.count,
:installable_bugfix_errata_count => self.installable_errata.bugfix.count,
:installable_enhancement_errata_count => self.installable_errata.enhancement.count,
:applicable_rpm_count => self.applicable_rpms.count,
:upgradable_rpm_count => self.installable_rpms.count
)
end
Actions