QUERY PLAN
GroupAggregate (cost=805.07..807.06 rows=22 width=36)
Group Key: im.created_by
-> Sort (cost=805.07..805.30 rows=95 width=32)
Sort Key: im.created_by
-> Hash Left Join (cost=373.56..801.94 rows=95 width=32)
Hash Cond: (im.case_id = c.id)
-> Seq Scan on tbl_implement_records im (cost=0.00..428.13 rows=95 width=28)
Filter: ((NOT is_draft) AND (arrived_at >= '2026-01-01 00:00:00+08'::timestamp with time zone) AND (arrived_at <= '2026-12-31 23:59:59+08'::timestamp with time zone) AND (created_by = ANY ('{5085,5248,1015,1022,5064,1023}'::integer[])))
-> Hash (cost=267.14..267.14 rows=8514 width=12)
-> Seq Scan on tbl_cases c (cost=0.00..267.14 rows=8514 width=12)