data-sort: generate sorted index before scheduling data-sort.

This will improve perfomance before data-sort kicks in.