Improve generation of indexes.