Very large log line and query in StoreSecurityReportsWorker
We found that StoreSecurityReportsWorker
issues a query that is very large in its textual representation. This can be a problem for Postgres for parsing the query but also when executing it. For our logging subsystem, this is a problem as the log line for the slow query contains the full query text and is about 1.6MB in size in our example.
/*application:sidekiq,correlation_id:01FNB8RG7NQ1QXGHVXNK5R47E5,jid:590a2274a254cbdd1e0d3294,endpoint_id:StoreSecurityReportsWorker,db_config_name:main*/
SELECT "vulnerability_occurrences".* FROM "vulnerability_occurrences" WHERE "vulnerability_occurrences"."project_id" = 20057221 AND "vulnerability_occurrences"."uuid" IN (/* very long list of UUIDs here */)
We'd like to investigate if we can get a grip on the query size (textual representation), e.g. by batching across those uuids and limiting the batch size.