Uploaded image for project: 'Satellite'
  1. Satellite
  2. SAT-5620

Authorization generates inefficient SQL query for taxonomy-overriden permissions

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Normal Normal
    • None
    • 6.8.0
    • Users and Roles
    • None
    • None
    • None
    • None
    • None

      Description of problem:
      Job execution lookups prior to firing off a new job was suddenly very slow, taking upwards of 5 minutes to instantiate a single job execution.
      After creating a new index on the foreman database, job execution instantiation went back to the usual duration of 3 seconds.

      The index was created on the taxable_taxonomies table with the command below:

      create unique index taxable_id_id on taxable_taxonomies (taxable_id, id);

      Version-Release number of selected component (if applicable):
      satellite-6.8.5-1.el7sat.noarch

      How reproducible:
      100% of times when invoking a new job.

      Steps to Reproduce:
      1. Invoke new job on the web UI or through hammer.

      Actual results:
      Takes upwards of 5 minutes to create the job.

      Expected results:
      Few seconds to create the job.

      Additional info:
      The new index was created after examining the SQL queries being run by foreman while invoking the job. The new DB index changed the job template lookup significantly: the sql query now avoids nested loops and does merge joins and hashed joins instead.

              jira-bugzilla-migration RH Bugzilla Integration
              aruzicka@redhat.com Adam Ruzicka
              Danny Synk Danny Synk
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: