data-sort: use same index for sorted and unsorted bases