Project

General

Profile

Actions

Bug #23270

closed

slow query when updating content facet applicability counts

Added by Justin Sherrill about 6 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Normal
Category:
Hosts
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

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

Related issues 1 (0 open1 closed)

Related to Katello - Bug #23296: Index name 'index_katello_content_facet_applicable_rpms_on_content_facet_id' on table 'katello_content_facet_applicable_rpms' is too long; the limit is 62 charactersClosedEvgeni Golov04/17/2018Actions
Actions #1

Updated by The Foreman Bot about 6 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/Katello/katello/pull/7309 added
Actions #2

Updated by Justin Sherrill about 6 years ago

  • Bugzilla link set to 1567978
Actions #3

Updated by Justin Sherrill about 6 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100
Actions #4

Updated by Justin Sherrill about 6 years ago

  • Related to Bug #23296: Index name 'index_katello_content_facet_applicable_rpms_on_content_facet_id' on table 'katello_content_facet_applicable_rpms' is too long; the limit is 62 characters added
Actions #5

Updated by Justin Sherrill about 6 years ago

  • translation missing: en.field_release set to 338
Actions

Also available in: Atom PDF