Only resets used indexes when rebuilding the cache.