QUERY PLAN
Aggregate (cost=101.99..102.00 rows=1 width=8)
-> Nested Loop (cost=0.28..101.99 rows=1 width=4)
-> Seq Scan on tbl_pre_sales ps (cost=0.00..93.62 rows=1 width=8)
Filter: ((NOT is_draft) AND (start_at >= '2025-08-04 00:00:00+08'::timestamp with time zone) AND (start_at <= '2025-08-04 23:59:59+08'::timestamp with time zone))
-> Index Scan using tbl_cases_pkey on tbl_cases c (cost=0.28..8.30 rows=1 width=4)
Index Cond: (id = ps.case_id)
Filter: (deduct_points_from = 5087)