QUERY PLAN
Sort (cost=10.54..10.55 rows=2 width=10)
Sort Key: d."order"
-> Group (cost=10.52..10.53 rows=2 width=10)
Group Key: u.id, d.id
-> Sort (cost=10.52..10.52 rows=2 width=10)
Sort Key: u.id, d.id
-> Hash Left Join (cost=1.20..10.51 rows=2 width=10)
Hash Cond: (u.department_id = d.id)
-> Seq Scan on tbl_users u (cost=0.00..9.30 rows=2 width=8)
Filter: ((user_status = '1'::type_global_user_status) AND ((id = 1004) OR (id = ANY ('{1011,1017,5015,5087}'::integer[])) OR (id = ANY ('{5329,5359,5364}'::integer[]))))
-> Hash (cost=1.09..1.09 rows=9 width=6)
-> Seq Scan on tbl_departments d (cost=0.00..1.09 rows=9 width=6)