QUERY PLAN
Sort (cost=10.01..10.02 rows=1 width=10)
Sort Key: d."order"
-> Group (cost=9.99..10.00 rows=1 width=10)
Group Key: u.id, d.id
-> Sort (cost=9.99..10.00 rows=1 width=10)
Sort Key: u.id, d.id
-> Nested Loop Left Join (cost=0.00..9.98 rows=1 width=10)
Join Filter: (u.department_id = d.id)
-> Seq Scan on tbl_users u (cost=0.00..8.78 rows=1 width=8)
Filter: ((user_status = '1'::type_global_user_status) AND ((id = 5295) OR (id = 1001) OR (id = ANY ('{1015,5295}'::integer[]))))
-> Seq Scan on tbl_departments d (cost=0.00..1.09 rows=9 width=6)