QUERY PLAN
Aggregate (cost=634.64..634.65 rows=1 width=32)
-> Hash Right Join (cost=437.43..634.64 rows=1 width=8)
Hash Cond: (ca.case_id = c.id)
-> Seq Scan on tbl_case_assignments ca (cost=0.00..174.70 rows=8570 width=12)
-> Hash (cost=437.42..437.42 rows=1 width=4)
-> Seq Scan on tbl_cases c (cost=0.00..437.42 rows=1 width=4)
Filter: ((closed_at >= '2026-06-09 00:00:00+08'::timestamp with time zone) AND (closed_at <= '2026-06-09 23:59:59+08'::timestamp with time zone) AND (deduct_points_from = ANY ('{1001,1004,1005,1013,5087,5295,5300,5311,5332,5449,5467,5476}'::integer[])))