Issue #2972 immutable schema snapshot is done before index save.
Issue #2972 few performance optimizations.