QUERY PLAN
Aggregate (cost=23.25..23.26 rows=1 width=32)
-> Hash Right Join (cost=7.75..21.91 rows=536 width=5)
Hash Cond: (eipss.erp_sales_outbound_id = t.id)
-> Seq Scan on tbl_erp_inventory_product_spents eipss (cost=0.00..12.65 rows=565 width=9)
-> Hash (cost=5.92..5.92 rows=146 width=4)
-> Seq Scan on tbl_erp_sales_outbounds t (cost=0.00..5.92 rows=146 width=4)
Filter: (status = 2)