-
Task
-
Resolution: Done
-
Major
-
None
-
False
-
False
-
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[]