QUERY PLAN
Sort (cost=9.61..9.64 rows=9 width=156)
Sort Key: tbl_departments."order"
-> Hash Join (cost=8.26..9.47 rows=9 width=156)
Hash Cond: (tbl_departments.id = tbl_users.department_id)
-> Seq Scan on tbl_departments (cost=0.00..1.09 rows=9 width=152)
-> Hash (cost=8.14..8.14 rows=9 width=4)
-> HashAggregate (cost=8.05..8.14 rows=9 width=4)
Group Key: tbl_users.department_id
-> Seq Scan on tbl_users (cost=0.00..7.76 rows=117 width=4)
Filter: (user_status = '-1'::type_global_user_status)