QUERY PLAN
Aggregate (cost=26.18..26.19 rows=1 width=32)
-> Hash Right Join (cost=13.51..26.17 rows=1 width=32)
Hash Cond: (eipss.erp_sales_outbound_id = t.id)
-> Seq Scan on tbl_erp_inventory_product_spents eipss (cost=0.00..12.10 rows=210 width=36)
-> Hash (cost=13.50..13.50 rows=1 width=4)
-> Seq Scan on tbl_erp_sales_outbounds t (cost=0.00..13.50 rows=1 width=4)
Filter: ((status = ANY ('{2,5}'::integer[])) AND (created_at >= '2025-08-01 00:00:00+08'::timestamp with time zone) AND (created_at <= '2025-08-31 23:59:59+08'::timestamp with time zone))