QUERY PLAN
Sort (cost=124.55..124.57 rows=9 width=156)
Sort Key: tbl_departments."order"
-> Hash Join (cost=123.19..124.41 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=123.08..123.08 rows=9 width=4)
-> HashAggregate (cost=122.99..123.08 rows=9 width=4)
Group Key: tbl_users.department_id
-> Seq Scan on tbl_users (cost=114.67..122.78 rows=82 width=4)
Filter: ((user_status = '1'::type_global_user_status) OR (hashed SubPlan 1))
SubPlan 1
-> Seq Scan on tbl_approve_carbon_copy_rels (cost=0.00..114.66 rows=3 width=4)
Filter: (approve_id = 2231)