Adding user_name_sort_by see BT#6535
Reordering queries.