Improve performance for merging 2 sets of keys