def _partition_index_names(provisioned_index_names, index_names):
    """Returns 3 disjoint sets of indexes: existing, to be created, and to be deleted."""
    existing_index_names = set()
    new_index_names = set()
    for name in index_names:
        if name in provisioned_index_names:
            existing_index_names.add(name)
        else:
            new_index_names.add(name)
    index_names_to_be_deleted = provisioned_index_names - existing_index_names
    return existing_index_names, new_index_names, index_names_to_be_deleted