QUERY PLAN
Sort (cost=14.38..14.39 rows=6 width=10)
Sort Key: d."order"
-> Group (cost=14.26..14.30 rows=6 width=10)
Group Key: u.id, d.id
-> Sort (cost=14.26..14.27 rows=6 width=10)
Sort Key: u.id, d.id
-> Hash Left Join (cost=1.20..14.18 rows=6 width=10)
Hash Cond: (u.department_id = d.id)
-> Seq Scan on tbl_users u (cost=0.00..12.95 rows=6 width=8)
Filter: ((user_status = '1'::type_global_user_status) AND (id = ANY ('{1001,1022,1015,5420,5445,5440,5085,5311,5248,5252,5404,5446,5332,1011,5250,1023,5295,1005,5016,5329,5388,5087,5064,1004,1017,1013,5360,5296,5300,1000}'::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)