QUERY PLAN
Aggregate (cost=147.91..147.92 rows=1 width=32)
-> Hash Join (cost=106.41..147.90 rows=1 width=6)
Hash Cond: (ects.erp_collect_ticket_id = t.id)
-> Seq Scan on tbl_erp_collect_ticket_settles ects (cost=0.00..35.83 rows=2154 width=10)
Filter: (sales_contract_id IS NOT NULL)
-> Hash (cost=106.40..106.40 rows=1 width=4)
-> Seq Scan on tbl_erp_collect_tickets t (cost=0.00..106.40 rows=1 width=4)
Filter: ((bank_settle_at >= '2026-05-29 00:00:00+08'::timestamp with time zone) AND (bank_settle_at <= '2026-05-29 23:59:59+08'::timestamp with time zone) AND (status = 2))