QUERY PLAN
Aggregate (cost=24.35..24.36 rows=1 width=32)
-> Hash Right Join (cost=9.04..23.00 rows=538 width=5)
Hash Cond: (eipss.erp_sales_gift_id = t.id)
-> Seq Scan on tbl_erp_inventory_product_spents eipss (cost=0.00..12.51 rows=551 width=9)
-> Hash (cost=7.54..7.54 rows=120 width=4)
-> Seq Scan on tbl_erp_sales_gifts t (cost=0.00..7.54 rows=120 width=4)
Filter: (status = 2)