Source:
<code>public SearchQueryExecutor getExecutionPlan(SearchQuery query, Segment segment) { final QueryableIndex index = segment.asQueryableIndex(); if (index != null) { final Filter filter = Filters.convertToCNFFromQueryContext(query, Filters.toFilter(query.getDimensionsFilter())); final List<Interval> intervals = query.getQuerySegmentSpec().getIntervals(); if (intervals.size() != 1) { throw new IAE("Should only have one interval, got[%s]", intervals); } final Interval interval = intervals.get(0); final ImmutableBitmap timeFilteredBitmap = IndexOnlyExecutor.makeTimeFilteredBitmap(index, segment, filter, interval); final Iterable<DimensionSpec> dimsToSearch = SearchQueryExecutor.getDimsToSearch(index.getAvailableDimensions(), query.getDimensions()); if (filter == null || index.getDecisionHelper().hasLowCardinality(index, dimsToSearch) || index.getDecisionHelper().hasHighSelectivity(index, timeFilteredBitmap)) { <START> log.info("Index-only execution strategy is selected"); <END> return new IndexOnlyExecutor(query, segment); } else { log.info("Cursor-based execution strategy is selected"); return new CursorBasedExecutor(query, segment); } } else { log.info("Index doesn't exist. Fall back to cursor-based execution strategy"); return new CursorBasedExecutor(query, segment); } }</code><technical_language>log info level query execution, logs. debug trace is preferred</technical_language>

Target:
public List<SearchQueryExecutor> getExecutionPlan(SearchQuery query, Segment segment) { final QueryableIndex index = segment.asQueryableIndex(); if (index != null) { final BitmapIndexSelector selector = new ColumnSelectorBitmapIndexSelector( index.getBitmapFactoryForDimensions(), index ); if (filter == null || filter.supportsBitmapIndex(selector)) { final ImmutableBitmap timeFilteredBitmap = UseIndexesStrategy.makeTimeFilteredBitmap( index, segment, filter, interval ); final List<DimensionSpec> dimsToSearch = getDimsToSearch( index.getAvailableDimensions(), query.getDimensions() ); final SearchQueryDecisionHelper helper = getDecisionHelper(index); final double useIndexStrategyCost = helper.getBitmapIntersectCost() * computeTotalCard(index, dimsToSearch); final double cursorOnlyStrategyCost = (timeFilteredBitmap == null ? index.getNumRows() : timeFilteredBitmap.size()) * dimsToSearch.size(); log.debug("Use-index strategy cost: %f, cursor-only strategy cost: %f", useIndexStrategyCost, cursorOnlyStrategyCost ); if (useIndexStrategyCost < cursorOnlyStrategyCost) { log.debug("Use-index execution strategy is selected, query id [%s]", query.getId()); return UseIndexesStrategy.withTimeFilteredBitmap(query, timeFilteredBitmap).getExecutionPlan(query, segment); } else { log.debug("Cursor-only execution strategy is selected, query id [%s]", query.getId()); return CursorOnlyStrategy.of(query).getExecutionPlan(query, segment); } } else { log.debug( "Filter doesn't support bitmap index. Fall back to cursor-only execution strategy, query id [%s]", query.getId() ); return CursorOnlyStrategy.of(query).getExecutionPlan(query, segment); } } else { log.debug("Index doesn't exist. Fall back to cursor-only execution strategy, query id [%s]", query.getId()); return CursorOnlyStrategy.of(query).getExecutionPlan(query, segment); } }