QUERY PLAN
Aggregate (cost=26.90..26.91 rows=1 width=8)
-> Sort (cost=26.35..26.44 rows=37 width=3485)
Sort Key: d."order", dp.created_at, u.pinyin1 NULLS FIRST, u.namecut1 NULLS FIRST, u.pinyin2 NULLS FIRST, u.namecut2 NULLS FIRST, u.pinyin3 NULLS FIRST, u.namecut3 NULLS FIRST, u.pinyin4 NULLS FIRST, u.namecut4 NULLS FIRST
-> HashAggregate (cost=25.01..25.38 rows=37 width=3485)
Group Key: u.id, d."order", dp.created_at
-> Hash Left Join (cost=19.79..24.74 rows=37 width=45)
Hash Cond: (u.department_position_id = dp.id)
-> Hash Left Join (cost=18.32..23.14 rows=37 width=41)
Hash Cond: (u.department_id = d.id)
-> Hash Right Join (cost=17.11..21.80 rows=37 width=43)
Hash Cond: (aa.user_id = u.id)
-> Seq Scan on tbl_auth_assignments aa (cost=0.00..4.12 rows=212 width=15)
-> Hash (cost=16.80..16.80 rows=25 width=43)
-> Seq Scan on tbl_users u (cost=0.00..16.80 rows=25 width=43)
Filter: (user_status = ANY ('{1,2}'::type_global_user_status[]))
-> 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)
-> Hash (cost=1.21..1.21 rows=21 width=12)
-> Seq Scan on tbl_department_positions dp (cost=0.00..1.21 rows=21 width=12)