QUERY PLAN
Sort (cost=22.44..22.45 rows=4 width=10)
Sort Key: d."order"
-> Group (cost=22.37..22.40 rows=4 width=10)
Group Key: u.id, d.id
-> Sort (cost=22.37..22.38 rows=4 width=10)
Sort Key: u.id, d.id
-> Hash Left Join (cost=1.20..22.33 rows=4 width=10)
Hash Cond: (u.department_id = d.id)
-> Seq Scan on tbl_users u (cost=0.00..21.12 rows=4 width=8)
Filter: ((user_status = '1'::type_global_user_status) AND (id = ANY ('{5311,1001,5064,1000,5295,1023,5446,5252,5085,1022,5250,5087,1004,1013,5360,1005,5476,5016,5332,5461,5248,1015,1011,5300}'::integer[])))
-> 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)