How about avoiding adding LegacyDelete if the result of to_index_key and to_legacy_index_key is the same? One less possibility of a performance regression right there.