fast get_indices