Add partition by median and parallel sort integration