QUERY PLAN
Aggregate (cost=30.92..30.93 rows=1 width=8)
-> Nested Loop (cost=0.00..30.92 rows=1 width=4)
Join Filter: (otc.operation_task_id = ot.id)
-> Seq Scan on tbl_operation_tasks ot (cost=0.00..13.62 rows=3 width=4)
Filter: (head_of = ANY ('{5493,5493}'::integer[]))
-> Materialize (cost=0.00..17.21 rows=2 width=8)
-> Seq Scan on tbl_operation_task_contacts otc (cost=0.00..17.20 rows=2 width=8)
Filter: ((complete_at >= '2026-05-29 00:00:00+08'::timestamp with time zone) AND (complete_at <= '2026-05-29 23:59:59+08'::timestamp with time zone))