@Override public IndexGroupScan getGroupScan() { return getIndexDescriptor().getIndexGroupScan(); }
public CoveringPlanNoFilterGenerator(IndexCallContext indexContext, FunctionalIndexInfo functionInfo, boolean isSingleton, PlannerSettings settings) { super(indexContext, null, null, null, settings); this.functionInfo = functionInfo; this.indexDesc = functionInfo == null ? null : functionInfo.getIndexDesc(); this.indexGroupScan = functionInfo == null ? null : functionInfo.getIndexDesc().getIndexGroupScan(); this.isSingletonSortedStream = isSingleton; }
for (IndexGroup index : nonCoveringIndexes) { IndexDescriptor indexDesc = index.getIndexProps().get(0).getIndexDesc(); IndexGroupScan idxScan = indexDesc.getIndexGroupScan(); IndexProperties indexProps = index.getIndexProps().get(0); IndexDescriptor indexDesc = indexProps.getIndexDesc(); IndexGroupScan idxScan = indexDesc.getIndexGroupScan(); FunctionalIndexInfo indexInfo = indexDesc.getFunctionalInfo(); IndexProperties indexProps = index.getIndexProps().get(0); IndexDescriptor indexDesc = indexProps.getIndexDesc(); IndexGroupScan idxScan = indexDesc.getIndexGroupScan();
IndexSelector selector = new IndexSelector(indexContext); for (IndexDescriptor indexDesc : indexCollection) { indexDesc.getIndexGroupScan().setStatistics(groupScan.getStatistics()); FunctionalIndexInfo functionInfo = indexDesc.getFunctionalInfo(); if (IndexPlanUtils.isCoveringIndex(indexContext, functionInfo)) {
IndexGroupScan indexScan = index.getIndexGroupScan(); RelDataType indexScanRowType = FunctionalIndexHelper.convertRowTypeForIndexScan( origScan, indexContext.getOrigMarker(), indexScan, functionInfo);
private boolean buildAndCheckCollation(IndexProperties indexProps) { IndexDescriptor indexDesc = indexProps.getIndexDesc(); FunctionalIndexInfo functionInfo = indexDesc.getFunctionalInfo(); RelCollation inputCollation; // for the purpose of collation we can assume that a covering index scan would provide // the collation property that would be relevant for non-covering as well ScanPrel indexScanPrel = IndexPlanUtils.buildCoveringIndexScan(indexContext.getScan(), indexDesc.getIndexGroupScan(), indexContext, indexDesc); inputCollation = indexScanPrel.getTraitSet().getTrait(RelCollationTraitDef.INSTANCE); // we don't create collation for Filter because it will inherit the child's collation if (indexContext.hasLowerProject()) { inputCollation = IndexPlanUtils.buildCollationProject(indexContext.getLowerProject().getProjects(), null, indexContext.getScan(), functionInfo,indexContext); } if (indexContext.hasUpperProject()) { inputCollation = IndexPlanUtils.buildCollationProject(indexContext.getUpperProject().getProjects(), indexContext.getLowerProject(), indexContext.getScan(), functionInfo, indexContext); } if ((inputCollation != null) && (inputCollation.satisfies(indexContext.getCollation()))) { return true; } return false; }