QUERY PLAN
HashAggregate (cost=31.69..34.17 rows=45 width=580)
Group Key: eip.product_id
-> Hash Join (cost=1.03..29.33 rows=45 width=64)
Hash Cond: (eip.erp_store_id = saleable_store.id)
-> Seq Scan on tbl_erp_inventory_products eip (cost=0.00..27.56 rows=90 width=68)
Filter: (product_id = ANY ('{1671,1275,2171,2257,2232,2258,2259,2260,867,870,2269,1372,2261,2262,1584,1558,1562,868,2177}'::integer[]))
-> Hash (cost=1.02..1.02 rows=1 width=4)
-> Seq Scan on tbl_erp_stores saleable_store (cost=0.00..1.02 rows=1 width=4)
Filter: ((NOT is_delete) AND is_saleable_inventory)