QUERY PLAN
Nested Loop (cost=0.42..9.62 rows=1 width=561)
-> Nested Loop (cost=0.27..9.37 rows=1 width=565)
-> Seq Scan on tbl_erp_sales_outbound_spent_product_sns r (cost=0.00..1.04 rows=1 width=561)
Filter: ((NOT is_cancel) AND (erp_inventory_product_sn_id = 52))
-> Index Scan using tbl_erp_sales_outbound_spent_products_pkey on tbl_erp_sales_outbound_spent_products eprp (cost=0.27..8.29 rows=1 width=8)
Index Cond: (id = r.erp_sales_outbound_spent_product_id)
-> Index Scan using tbl_erp_sales_outbounds_pkey on tbl_erp_sales_outbounds epr (cost=0.14..0.25 rows=1 width=4)
Index Cond: (id = eprp.erp_sales_outbound_id)
Filter: (status = ANY ('{1,2}'::integer[]))