Refactored pg_split_sort