QUERY PLAN
Sort (cost=2.62..2.63 rows=1 width=22)
Sort Key: eg.sort
-> Group (cost=2.60..2.61 rows=1 width=22)
Group Key: eg.id
-> Sort (cost=2.60..2.60 rows=3 width=18)
Sort Key: eg.id
-> Nested Loop (cost=0.00..2.57 rows=3 width=18)
Join Filter: (eg.id = egr.engineer_group_id)
-> Seq Scan on tbl_engineer_groups eg (cost=0.00..1.02 rows=1 width=18)
Filter: (id <> 999999)
-> Seq Scan on tbl_engineer_group_relationships egr (cost=0.00..1.47 rows=6 width=4)
Filter: (engineer_id = ANY ('{5085,5248,1015,1022,5064,1023}'::integer[]))