QUERY PLAN
Aggregate (cost=53.91..53.92 rows=1 width=16)
-> Append (cost=0.00..53.90 rows=2 width=16)
-> Nested Loop (cost=0.00..27.02 rows=1 width=16)
Join Filter: (ir.case_id = c.id)
-> Seq Scan on tbl_implement_records ir (cost=0.00..13.75 rows=1 width=20)
Filter: ((NOT is_draft) AND (arrived_at >= '2026-05-29 00:00:00+08'::timestamp with time zone) AND (arrived_at <= '2026-05-29 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)
-> Nested Loop (cost=0.00..26.87 rows=1 width=16)
Join Filter: (ps.case_id = c_1.id)
-> Seq Scan on tbl_pre_sales ps (cost=0.00..13.60 rows=1 width=20)
Filter: ((NOT is_draft) AND (start_at >= '2026-05-29 00:00:00+08'::timestamp with time zone) AND (start_at <= '2026-05-29 23:59:59+08'::timestamp with time zone))
-> Seq Scan on tbl_cases c_1 (cost=0.00..13.25 rows=1 width=4)
Filter: (deduct_points_from = 5493)