QUERY PLAN
HashAggregate (cost=3.74..3.81 rows=6 width=44)
Group Key: g.name
-> Hash Join (cost=1.14..3.60 rows=14 width=16)
Hash Cond: (sgr.group_id = g.id)
-> Seq Scan on tbl_sales_group_relationships sgr (cost=0.00..2.40 rows=14 width=8)
Filter: (sales_id = ANY ('{5500,5499,5332,1001,5087,5467,5300,5311,5295,1013,5476,1004,1005,5449}'::integer[]))
-> Hash (cost=1.06..1.06 rows=6 width=16)
-> Seq Scan on tbl_groups g (cost=0.00..1.06 rows=6 width=16)