QUERY PLAN
Sort (cost=2.63..2.63 rows=1 width=158)
Sort Key: eg.sort
-> HashAggregate (cost=2.61..2.62 rows=1 width=158)
Group Key: eg.id
-> Hash Join (cost=1.04..2.60 rows=4 width=154)
Hash Cond: (egr.engineer_group_id = eg.id)
-> Seq Scan on tbl_engineer_group_relationships egr (cost=0.00..1.54 rows=8 width=4)
Filter: (engineer_id = ANY ('{1017,5085,1001,5248,1015,1022,5296,1023}'::integer[]))
-> Hash (cost=1.02..1.02 rows=1 width=154)
-> Seq Scan on tbl_engineer_groups eg (cost=0.00..1.02 rows=1 width=154)
Filter: (id <> 999999)