multithread sort in tree index build from snapshot