LPS-46764 Rewrite of reindex logic, to avoid reindex of all versions at most cases