Optimize query: Model - Stalled Workflow Check

File: ee/app/models/ai/duo_workflows/workflow.rb (Line 196)

!created? && !checkpoints.exists?

Generated SQL:

SELECT 1 AS one 
FROM "p_duo_workflows_checkpoints" 
WHERE "p_duo_workflows_checkpoints"."workflow_id" = $1 
LIMIT 1

Optimization needed: Ensure query includes created_at filter for partition pruning.