QUERY PLAN
Limit (cost=17.26..17.31 rows=20 width=275)
-> Sort (cost=17.26..17.35 rows=37 width=275)
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=15.93..16.30 rows=37 width=275)
Group Key: u.id, d."order", dp.created_at
-> Hash Left Join (cost=10.73..15.65 rows=37 width=275)
Hash Cond: (u.department_position_id = dp.id)
-> Hash Left Join (cost=9.28..14.08 rows=37 width=267)
Hash Cond: (u.department_id = d.id)
-> Hash Right Join (cost=8.07..12.74 rows=37 width=265)
Hash Cond: (aa.user_id = u.id)
-> Seq Scan on tbl_auth_assignments aa (cost=0.00..4.10 rows=210 width=15)
-> Hash (cost=7.76..7.76 rows=25 width=265)
-> Seq Scan on tbl_users u (cost=0.00..7.76 rows=25 width=265)
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.20..1.20 rows=20 width=12)
-> Seq Scan on tbl_department_positions dp (cost=0.00..1.20 rows=20 width=12)