List<TPreparedExpression> vars = new ArrayList<>(plan.ncols);
for (int i = 0; i < plan.ncols; i++) {
// Convert from index column position to parameter number.
Column indexedColumn = crossReferencedColumns.get(i);
int fkpos = referencedColumns.indexOf(indexedColumn);
vars.add(new TPreparedParameter(fkpos, indexedColumn.getType()));
}
UnboundExpressions indexExprs = new RowBasedUnboundExpressions(indexRowType, vars);
IndexBound indexBound = new IndexBound(indexExprs, plan);
IndexKeyRange indexKeyRange = IndexKeyRange.bounded(indexRowType, indexBound, true, indexBound, true);
input = API.indexScan_Default(indexRowType, indexKeyRange, 1);