Heuristic filter and MapReduce-based sorting