Optimize query: Presenter - Latest Checkpoint

File: ee/app/presenters/ai/duo_workflows/workflow_presenter.rb (Line 32)

workflow.checkpoints.last

Generated SQL:

SELECT "p_duo_workflows_checkpoints".* 
FROM "p_duo_workflows_checkpoints" 
WHERE "p_duo_workflows_checkpoints"."workflow_id" = $1 
ORDER BY "p_duo_workflows_checkpoints"."id" DESC 
LIMIT 1

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