QUERY PLAN
GroupAggregate (cost=587.39..588.07 rows=22 width=36)
Group Key: ca.engineer_id
-> Sort (cost=587.39..587.53 rows=54 width=12)
Sort Key: ca.engineer_id
-> Hash Join (cost=332.01..585.84 rows=54 width=12)
Hash Cond: (ca.case_id = c.id)
-> Seq Scan on tbl_case_assignments ca (cost=0.00..238.98 rows=5655 width=16)
Filter: (engineer_id = ANY ('{5085,5248,1015,1022,5064,1023}'::integer[]))
-> Hash (cost=331.00..331.00 rows=81 width=4)
-> Seq Scan on tbl_cases c (cost=0.00..331.00 rows=81 width=4)
Filter: ((closed_at >= '2025-01-01 00:00:00+08'::timestamp with time zone) AND (closed_at <= '2025-06-15 23:59:59+08'::timestamp with time zone) AND (case_type = 1))