DrillCostFactory costFactory = (DrillCostFactory)planner.getCostFactory(); double totalRows = indexProps.getTotalRows(); double leadRowCount = indexProps.getLeadingSelectivity() * totalRows; double avgRowSize = indexProps.getAvgRowSize(); if (indexProps.isCovering()) { // covering index
o1NumLeadingFilters = o1.get(0).numLeadingFilters(); o1SatisfiesCollation = o1.get(0).satisfiesCollation(); o1LeadingSelectivity = o1.get(0).getLeadingSelectivity(); } else { o1Covering = false; o1NumLeadingFilters+=o1.get(idx).numLeadingFilters(); o1LeadingSelectivity = o1.get(0).getLeadingSelectivity(); for (int idx=1; idx<o1.size(); idx++) { o1LeadingSelectivity*=o1.get(idx).getLeadingSelectivity(); o2NumLeadingFilters = o2.get(0).numLeadingFilters(); o2SatisfiesCollation = o2.get(0).satisfiesCollation(); o2LeadingSelectivity = o2.get(0).getLeadingSelectivity(); } else { o2Covering = false; o2NumLeadingFilters+=o2.get(idx).numLeadingFilters(); o2LeadingSelectivity = o2.get(0).getLeadingSelectivity(); for (int idx=1; idx<o2.size(); idx++) { o2LeadingSelectivity*=o2.get(idx).getLeadingSelectivity();
if (indexesInCandidate.isIntersectIndex()) { for (IndexProperties prop : indexesInCandidate.getIndexProps()) { currSel *= prop.getLeadingSelectivity();
if (settings.isDisableFullTableScan() || p.getLeadingSelectivity() <= selThreshold) { IndexGroup index = new IndexGroup(); index.addIndexProp(p); if (p.getLeadingSelectivity() > selThreshold) { logger.debug("Skipping index {}. The leading selectivity {} is larger than threshold {}", p.getIndexDesc().getIndexName(), p.getLeadingSelectivity(), selThreshold); indexProps.getIndexDesc().getIndexName(), indexProps.satisfiesCollation(), indexProps.getLeadingSelectivity(), indexProps.getSelfCost(planner)); count++; indexProps.getIndexDesc().getIndexName(), indexProps.satisfiesCollation(), indexProps.getLeadingSelectivity(), indexProps.getSelfCost(planner)); count++; for (IndexProperties indexProps : index.getIndexProps()) { intersectIndex.addIndexProp(indexProps); isectLeadingSel *= indexProps.getLeadingSelectivity(); logger.info("name: {}, {}, collation: {}, leadingSelectivity: {}, cost: {}", indexProps.getIndexDesc().getIndexName(), isectName, indexProps.satisfiesCollation(), indexProps.getLeadingSelectivity(), indexProps.getSelfCost(planner));
DrillCostFactory costFactory = (DrillCostFactory)planner.getCostFactory(); double totalRows = indexProps.getTotalRows(); double leadRowCount = indexProps.getLeadingSelectivity() * totalRows; double avgRowSize = indexProps.getAvgRowSize(); if (indexProps.isCovering()) { // covering index
double leadRowCount = indexProps.getLeadingSelectivity() * indexProps.getRemainderSelectivity() * totalRows; totLeadRowCount *= indexProps.getLeadingSelectivity(); double avgRowSize = indexProps.getAvgRowSize(); Preconditions.checkArgument(primaryTableGroupScan instanceof DbGroupScan);