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

Optimize DockerMetaTag query and CV version deletion to run a single invocation of the method.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Normal Normal
    • None
    • 6.10.0
    • Repositories
    • None
    • None
    • None
    • None

      Test performance improvement between current query:

      self.where("id not in OR (schema2_id IS NULL AND schema1_id IS NULL)", Katello::RepositoryDockerMetaTag.pluck(:docker_meta_tag_id) + [0]).delete_all

      vs

      self.where("(id != 0 and id not in (select docker_meta_tag_id from #

      {Katello::RepositoryDockerMetaTag.table_name}

      )) OR (schema2_id IS NULL AND schema1_id IS NULL) ").delete_all

      Also, have this method called once per CV version delete vs once per CV version repo delete to save unnecessary calls.

              rhn-engineering-sajha Samir Jha
              satellite-focaccia-bot Focaccia Bot
              David Moore David Moore (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: