@Override public Object visitScan(Object object, LogicalPlan plan, LogicalPlan.QueryBlock block, ScanNode scanNode, Stack<LogicalNode> stack) throws TajoException { List<AccessPathInfo> accessPaths = block.getAccessInfos(scanNode); AccessPathInfo optimalPath = null;
@Override public Object visitScan(Object object, LogicalPlan plan, LogicalPlan.QueryBlock block, ScanNode scanNode, Stack<LogicalNode> stack) throws TajoException { List<AccessPathInfo> accessPaths = block.getAccessInfos(scanNode); AccessPathInfo optimalPath = null;
@Override public boolean isEligible(LogicalPlanRewriteRuleContext context) { if (context.getQueryContext().getBool(SessionVars.INDEX_ENABLED)) { for (LogicalPlan.QueryBlock block : context.getPlan().getQueryBlocks()) { for (RelationNode relationNode : block.getRelations()) { List<AccessPathInfo> accessPathInfos = block.getAccessInfos(relationNode); // If there are any alternative access paths if (accessPathInfos.size() > 1) { for (AccessPathInfo accessPathInfo : accessPathInfos) { if (accessPathInfo.getScanType() == AccessPathInfo.ScanTypeControl.INDEX_SCAN) { return true; } } } } } } return false; }
@Override public boolean isEligible(LogicalPlanRewriteRuleContext context) { if (context.getQueryContext().getBool(SessionVars.INDEX_ENABLED)) { for (LogicalPlan.QueryBlock block : context.getPlan().getQueryBlocks()) { for (RelationNode relationNode : block.getRelations()) { List<AccessPathInfo> accessPathInfos = block.getAccessInfos(relationNode); // If there are any alternative access paths if (accessPathInfos.size() > 1) { for (AccessPathInfo accessPathInfo : accessPathInfos) { if (accessPathInfo.getScanType() == AccessPathInfo.ScanTypeControl.INDEX_SCAN) { return true; } } } } } } return false; }