QUERY PLAN
HashAggregate (cost=3.37..3.43 rows=5 width=178)
Group Key: g.name
-> Hash Join (cost=1.11..3.26 rows=11 width=150)
Hash Cond: (sgr.group_id = g.id)
-> Seq Scan on tbl_sales_group_relationships sgr (cost=0.00..2.12 rows=11 width=8)
Filter: (sales_id = ANY ('{5329,5332,5420,1001,5087,5300,5311,5295,1013,1004,1005}'::integer[]))
-> Hash (cost=1.05..1.05 rows=5 width=150)
-> Seq Scan on tbl_groups g (cost=0.00..1.05 rows=5 width=150)