QUERY PLAN
Nested Loop (cost=1.24..3.65 rows=1 width=561)
-> Hash Join (cost=1.10..3.24 rows=1 width=565)
Hash Cond: (eprp.id = r.erp_sales_gift_spent_product_id)
-> Seq Scan on tbl_erp_sales_gift_spent_products eprp (cost=0.00..1.82 rows=82 width=8)
-> Hash (cost=1.09..1.09 rows=1 width=561)
-> Seq Scan on tbl_erp_sales_gift_spent_product_sns r (cost=0.00..1.09 rows=1 width=561)
Filter: ((NOT is_cancel) AND (erp_inventory_product_sn_id = 13))
-> Index Scan using tbl_erp_sales_gifts_pkey on tbl_erp_sales_gifts epr (cost=0.14..0.40 rows=1 width=4)
Index Cond: (id = eprp.erp_sales_gift_id)
Filter: (status = ANY ('{1,2}'::integer[]))