QUERY PLAN
Aggregate (cost=27.02..27.03 rows=1 width=8)
-> Nested Loop (cost=0.00..27.01 rows=1 width=4)
Join Filter: (ir.case_id = c.id)
-> Seq Scan on tbl_implement_records ir (cost=0.00..13.75 rows=1 width=8)
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))
-> Seq Scan on tbl_cases c (cost=0.00..13.25 rows=1 width=4)
Filter: (deduct_points_from = 5493)