QUERY PLAN
Nested Loop (cost=1.26..5.63 rows=1 width=55)
-> Hash Join (cost=1.11..5.31 rows=1 width=59)
Hash Cond: (eprp.id = r.erp_sales_gift_spent_product_id)
-> Seq Scan on tbl_erp_sales_gift_spent_products eprp (cost=0.00..3.59 rows=159 width=8)
-> Hash (cost=1.10..1.10 rows=1 width=55)
-> Seq Scan on tbl_erp_sales_gift_spent_product_sns r (cost=0.00..1.10 rows=1 width=55)
Filter: ((NOT is_cancel) AND (erp_inventory_product_sn_id = 86))
-> Index Scan using tbl_erp_sales_gifts_pkey on tbl_erp_sales_gifts epr (cost=0.14..0.32 rows=1 width=4)
Index Cond: (id = eprp.erp_sales_gift_id)
Filter: (status = ANY ('{1,2}'::integer[]))