Rewrite history indexing.