Use iterator for indexing for large data