QUERY PLAN
Nested Loop Left Join (cost=16.98..31.19 rows=1 width=157)
Join Filter: (eip.erp_inventory_disassemble_id = eid.id)
Filter: ((eip.erp_inventory_disassemble_id IS NULL) OR (eid.status <> 6))
-> Nested Loop Left Join (cost=16.98..30.06 rows=1 width=161)
Join Filter: (eip.erp_inventory_build_id = eib.id)
Filter: ((eip.erp_inventory_build_id IS NULL) OR (eib.status <> 6))
-> Nested Loop Left Join (cost=16.98..28.76 rows=1 width=165)
Join Filter: (eip.erp_inventory_overflow_id = eio.id)
Filter: ((eip.erp_inventory_overflow_id IS NULL) OR (eio.status <> 6))
-> Nested Loop (cost=16.98..27.51 rows=1 width=169)
Join Filter: (eip.id = eipsn.erp_inventory_product_id)
-> Hash Right Join (cost=16.98..24.92 rows=1 width=16)
Hash Cond: (epi.id = eip.erp_purchase_inbound_id)
Filter: ((eip.erp_purchase_inbound_id IS NULL) OR (epi.status <> 6))
-> Seq Scan on tbl_erp_purchase_inbounds epi (cost=0.00..7.13 rows=213 width=6)
-> Hash (cost=16.96..16.96 rows=1 width=20)
-> Hash Right Join (cost=15.65..16.96 rows=1 width=20)
Hash Cond: (epg.id = eip.erp_purchase_gift_id)
Filter: ((eip.erp_purchase_gift_id IS NULL) OR (epg.status <> 6))
-> Seq Scan on tbl_erp_purchase_gifts epg (cost=0.00..1.22 rows=22 width=6)
-> Hash (cost=15.64..15.64 rows=1 width=24)
-> Seq Scan on tbl_erp_inventory_products eip (cost=0.00..15.64 rows=1 width=24)
Filter: (product_id = 2265)
-> Seq Scan on tbl_erp_inventory_product_sns eipsn (cost=0.00..2.54 rows=4 width=157)
Filter: ((sn)::text = ANY ('{5345,98789,35345345,3534534}'::text[]))
-> Seq Scan on tbl_erp_inventory_overflows eio (cost=0.00..1.10 rows=10 width=6)
-> Seq Scan on tbl_erp_inventory_builds eib (cost=0.00..1.12 rows=12 width=6)
-> Seq Scan on tbl_erp_inventory_disassembles eid (cost=0.00..1.05 rows=5 width=6)