Implement external mergesort as alternative to LevelDB.