QUERY PLAN
Nested Loop (cost=0.00..13.72 rows=1 width=560)
Join Filter: (eprp.erp_inventory_build_id = epr.id)
-> Nested Loop (cost=0.00..12.67 rows=1 width=564)
Join Filter: (r.erp_inventory_build_spent_product_id = eprp.id)
-> Seq Scan on tbl_erp_inventory_build_spent_product_sns r (cost=0.00..11.62 rows=1 width=560)
Filter: (erp_inventory_product_sn_id = 13)
-> Seq Scan on tbl_erp_inventory_build_spent_products eprp (cost=0.00..1.02 rows=2 width=8)
-> Seq Scan on tbl_erp_inventory_builds epr (cost=0.00..1.02 rows=2 width=4)
Filter: (status = ANY ('{1,2}'::integer[]))