Use a temporary index to reindex instead of the inplace one.