private IndexMaintainer(PTable dataTable, PTable index) {
this(dataTable.getRowKeySchema(), dataTable.getBucketNum() != null);
this.isMultiTenant = dataTable.isMultiTenant();
this.viewIndexId = index.getViewIndexId() == null ? null : MetaDataUtil.getViewIndexIdDataType().toBytes(index.getViewIndexId());
RowKeySchema dataRowKeySchema = dataTable.getRowKeySchema();
boolean isDataTableSalted = dataTable.getBucketNum() != null;
byte[] indexTableName = index.getPhysicalName().getBytes();
Integer nIndexSaltBuckets = index.getBucketNum();
boolean indexWALDisabled = index.isWALDisabled();
int indexPosOffset = (index.getBucketNum() == null ? 0 : 1) + (this.isMultiTenant ? 1 : 0) + (this.viewIndexId == null ? 0 : 1);
int nIndexColumns = index.getColumns().size() - indexPosOffset;
int nIndexPKColumns = index.getPKColumns().size() - indexPosOffset;
this.rowKeyMetaData = newRowKeyMetaData(nIndexPKColumns);
BitSet bitSet = this.rowKeyMetaData.getViewConstantColumnBitSet();
int dataPosOffset = (isDataTableSalted ? 1 : 0) + (this.isMultiTenant ? 1 : 0);
int nDataPKColumns = dataRowKeySchema.getFieldCount() - dataPosOffset;
// For indexes on views, we need to remember which data columns are "constants"
// These are the values in a VIEW where clause. For these, we don't put them in the
// index, as they're the same for every row in the index.
if (dataTable.getType() == PTableType.VIEW) {
List<PColumn>dataPKColumns = dataTable.getPKColumns();