Project

General

Profile

Actions

Bug #15253

closed

distinct used when finding applicable errata, causing severe slowdowns on dashboard

Added by Chris Duryee almost 8 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Errata Management
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

If you have >250 content hosts and >400 errata, the dashboard may take multiple minutes to load. It is due to this query:

 DISTINCT "katello_errata".* FROM "katello_errata" INNER JOIN "katello_content_facet_errata" ON "katello_content_facet_errata"."erratum_id" = "katello_errata"."id" INNER JOIN "katello_content_facet_errata" "content_facet_errata_katello_errata_join" ON "content_facet_errata_katello_errata_join"."erratum_id" = "katello_errata"."id" INNER JOIN "katello_content_facets" ON "katello_content_facets"."id" = "content_facet_errata_katello_errata_join"."content_facet_id" WHERE "katello_content_facets"."host_id" IN
(
       SELECT "hosts"."id" 
       FROM   "hosts" 
       WHERE  "hosts"."type"            IN ('Host::Managed')
       AND    "hosts"."organization_id" IN (1)) ORDER BY updated DESC limit 6;

note the "distinct" at the beginning, it causes a very large sort to happen!

         ->  Sort  (cost=50522.02..50628.22 rows=42483 width=1269) (actual time=63211.686..79656.391 rows=42483 loops=1)
               Sort Key: katello_errata.updated, katello_errata.id, katello_errata.uuid, katello_errata.errata_id, katello_errata.created_at, katello_errata.updated_at, katello_errata.issued, katello_errata.errata_type, katello_errata.se
verity, katello_errata.title, katello_errata.solution, katello_errata.description, katello_errata.summary, katello_errata.reboot_suggested
               Sort Method: external merge  Disk: 36304kB
Actions #1

Updated by The Foreman Bot almost 8 years ago

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

Updated by Chris Duryee almost 8 years ago

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

Updated by Eric Helms almost 8 years ago

  • translation missing: en.field_release set to 144
Actions #4

Updated by Eric Helms almost 8 years ago

  • translation missing: en.field_release changed from 144 to 143
Actions

Also available in: Atom PDF