QUERY PLAN
Sort (cost=2.52..2.52 rows=1 width=160)
Sort Key: eg.level, eg.sort
-> Group (cost=2.50..2.51 rows=1 width=160)
Group Key: eg.id
-> Sort (cost=2.50..2.50 rows=2 width=156)
Sort Key: eg.id
-> Hash Join (cost=1.04..2.49 rows=2 width=156)
Hash Cond: (egr.engineer_group_id = eg.id)
-> Seq Scan on tbl_engineer_group_relationships egr (cost=0.00..1.44 rows=5 width=4)
Filter: (engineer_id = ANY ('{5085,5248,1015,1022,1023}'::integer[]))
-> Hash (cost=1.02..1.02 rows=1 width=156)
-> Seq Scan on tbl_engineer_groups eg (cost=0.00..1.02 rows=1 width=156)
Filter: (id <> 999999)