QUERY PLAN
Aggregate (cost=630.96..630.97 rows=1 width=32)
-> Hash Right Join (cost=438.99..629.59 rows=545 width=8)
Hash Cond: (ca.case_id = c.id)
-> Seq Scan on tbl_case_assignments ca (cost=0.00..168.84 rows=8284 width=12)
-> Hash (cost=432.22..432.22 rows=542 width=4)
-> Seq Scan on tbl_cases c (cost=0.00..432.22 rows=542 width=4)
Filter: ((closed_at >= '2025-01-01 00:00:00+08'::timestamp with time zone) AND (closed_at <= '2025-12-31 23:59:59+08'::timestamp with time zone) AND (deduct_points_from = ANY ('{5329,5332,5448,5420,1001,5087,5300,5311,5295,1013,1004,1005,5449}'::integer[])))