index = new HashIndex(this, indexId, indexName, cols, indexType);
} else {
index = new NonUniqueHashIndex(this, indexId, indexName, cols, indexType);
}
} else {
index = new TreeIndex(this, indexId, indexName, cols, indexType);
}
if (database.isMultiVersion()) {
index = new MultiVersionIndex(index, this);
}
rebuildIfNeed(session, index, indexName);