QUERY PLAN
Aggregate (cost=116.92..116.93 rows=1 width=32)
-> Hash Join (cost=75.16..116.78 rows=57 width=6)
Hash Cond: (ects.erp_collect_ticket_id = t.id)
-> Seq Scan on tbl_erp_collect_ticket_settles ects (cost=0.00..35.94 rows=2160 width=10)
Filter: (sales_contract_id IS NOT NULL)
-> Hash (cost=74.43..74.43 rows=58 width=4)
-> Seq Scan on tbl_erp_collect_tickets t (cost=0.00..74.43 rows=58 width=4)
Filter: ((bank_settle_at >= '2026-01-01 00:00:00+08'::timestamp with time zone) AND (bank_settle_at <= '2026-12-31 23:59:59+08'::timestamp with time zone) AND (status = 2))