QUERY PLAN
Sort (cost=2.92..2.93 rows=4 width=158)
Sort Key: g.sort
-> HashAggregate (cost=2.84..2.88 rows=4 width=158)
Group Key: g.id
-> Hash Right Join (cost=1.11..2.74 rows=39 width=154)
Hash Cond: (sgr.group_id = g.id)
-> Seq Scan on tbl_sales_group_relationships sgr (cost=0.00..1.49 rows=49 width=4)
-> Hash (cost=1.06..1.06 rows=4 width=154)
-> Seq Scan on tbl_groups g (cost=0.00..1.06 rows=4 width=154)
Filter: (id <> 999999)