QUERY PLAN
Aggregate (cost=31.80..31.81 rows=1 width=64)
-> Hash Join (cost=17.40..31.63 rows=32 width=10)
Hash Cond: (esosps.erp_sales_outbound_id = t.id)
-> Hash Right Join (cost=9.65..23.79 rows=33 width=14)
Hash Cond: (eipss.erp_sales_outbound_spent_product_id = esosps.id)
-> Seq Scan on tbl_erp_inventory_product_spents eipss (cost=0.00..12.65 rows=565 width=14)
-> Hash (cost=9.34..9.34 rows=25 width=8)
-> Seq Scan on tbl_erp_sales_outbound_spent_products esosps (cost=0.00..9.34 rows=25 width=8)
Filter: (product_id = 941)
-> Hash (cost=5.92..5.92 rows=146 width=8)
-> Seq Scan on tbl_erp_sales_outbounds t (cost=0.00..5.92 rows=146 width=8)
Filter: (status = 2)