optimize for creating index