QUERY PLAN
Aggregate (cost=644.12..644.13 rows=1 width=8)
-> Hash Join (cost=281.35..644.06 rows=26 width=4)
Hash Cond: (ir.case_id = c.id)
-> Seq Scan on tbl_implement_records ir (cost=0.00..360.69 rows=770 width=8)
Filter: ((NOT is_draft) AND (arrived_at >= '2025-01-01 00:00:00+08'::timestamp with time zone) AND (arrived_at <= '2025-12-31 23:59:59+08'::timestamp with time zone))
-> Hash (cost=277.89..277.89 rows=277 width=4)
-> Seq Scan on tbl_cases c (cost=0.00..277.89 rows=277 width=4)
Filter: (deduct_points_from = 1001)