Uploaded image for project: 'Project Quay'
  1. Project Quay
  2. PROJQUAY-3245

Clair v4 optimize enrichment query

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Done
    • Icon: Major Major
    • clair-4.4.2
    • None
    • clair
    • 0

      After I was able to gain access to RDS:Performance Insights for the production Clair Matcher DB instance it seems the query that is using most of the CPU (4 currently, increasing to 16) is the query to look up enrichment data. We should explore ways of optimizing this query/operation in order to free up CPU.

      Query:

      
      WITH
          latest
              AS (
                  SELECT
                      max(id) AS id
                  FROM
                      update_operation
                  WHERE
                      updater = $1
              )
      SELECT
          e.tags, e.data
      FROM
          enrichment AS e,
          uo_enrich AS uo,
          latest
      WHERE
          uo.uo = latest.id
          AND uo.enrich = e.id
          AND e.tags && $2::text[]
      

            hdonnay Henry Donnay
            jcroslan@redhat.com Joseph Crosland
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: