QUERY PLAN
Aggregate (cost=25.18..25.19 rows=1 width=32)
-> Hash Right Join (cost=12.51..25.17 rows=1 width=32)
Hash Cond: (eipss.erp_sales_gift_id = t.id)
-> Seq Scan on tbl_erp_inventory_product_spents eipss (cost=0.00..12.10 rows=210 width=36)
-> Hash (cost=12.50..12.50 rows=1 width=4)
-> Seq Scan on tbl_erp_sales_gifts t (cost=0.00..12.50 rows=1 width=4)
Filter: (status = 2)