Skip to content

Statement timeout deleting cluster agents

Deleting a cluster agent record gives the following error:

PG::QueryCanceled: ERROR:  canceling statement due to statement timeout
CONTEXT:  SQL statement "UPDATE ONLY "public"."vulnerability_reads" SET "casted_cluster_agent_id" = NULL WHERE $1 OPERATOR(pg_catalog.=) "casted_cluster_agent_id""

This is happening because there is no (full) index on vulnerability_reads.casted_cluster_agent_id, which causes a sequential scan of vulnerability_reads when trying to execute the ON DELETE SET NULL foreign key action.

Edited by Tiger Watson