QUERY PLAN
GroupAggregate (cost=0.00..21.98 rows=1 width=159)
Group Key: e.id
-> Nested Loop Left Join (cost=0.00..21.95 rows=1 width=68)
Join Filter: (s.erp_sales_outbound_id = e.id)
-> Seq Scan on tbl_erp_sales_outbounds e (cost=0.00..7.88 rows=1 width=63)
Filter: ((id = 161) AND (status = 2))
-> Seq Scan on tbl_erp_inventory_product_spents s (cost=0.00..14.06 rows=1 width=9)
Filter: (erp_sales_outbound_id = 161)