Sorting processes in a distributed database and access method thereof