QUERY PLAN
Aggregate (cost=21.62..21.63 rows=1 width=32)
-> Hash Right Join (cost=6.14..20.28 rows=534 width=5)
Hash Cond: (eipss.erp_sales_gift_id = t.id)
-> Seq Scan on tbl_erp_inventory_product_spents eipss (cost=0.00..12.65 rows=565 width=9)
-> Hash (cost=4.61..4.61 rows=122 width=4)
-> Seq Scan on tbl_erp_sales_gifts t (cost=0.00..4.61 rows=122 width=4)
Filter: (status = 2)