QUERY PLAN
GroupAggregate (cost=51.33..51.83 rows=20 width=178)
Group Key: g.name
-> Sort (cost=51.33..51.38 rows=20 width=150)
Sort Key: g.name
-> Hash Join (cost=35.75..50.90 rows=20 width=150)
Hash Cond: (g.id = sgr.group_id)
-> Seq Scan on tbl_groups g (cost=0.00..13.30 rows=330 width=150)
-> Hash (cost=35.50..35.50 rows=20 width=8)
-> Seq Scan on tbl_sales_group_relationships sgr (cost=0.00..35.50 rows=20 width=8)
Filter: (sales_id = ANY ('{5493,5495}'::integer[]))