QUERY PLAN
Sort (cost=9.37..9.39 rows=9 width=156)
Sort Key: tbl_departments."order"
-> Hash Join (cost=8.02..9.23 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=7.90..7.90 rows=9 width=4)
-> HashAggregate (cost=7.81..7.90 rows=9 width=4)
Group Key: tbl_users.department_id
-> Seq Scan on tbl_users (cost=0.00..7.74 rows=30 width=4)
Filter: (user_status = '1'::type_global_user_status)