Class IndexSelector

java.lang.Object
org.apache.drill.exec.planner.index.IndexSelector

public class IndexSelector extends Object
  • Constructor Details

    • IndexSelector

      public IndexSelector(org.apache.calcite.rex.RexNode indexCondition, org.apache.calcite.rex.RexNode otherRemainderCondition, IndexCallContext indexContext, IndexCollection collection, org.apache.calcite.rex.RexBuilder rexBuilder, double totalRows)
    • IndexSelector

      public IndexSelector(IndexCallContext indexContext)
      This constructor is to build selector for no index condition case (no filter)
      Parameters:
      indexContext -
  • Method Details

    • addIndex

      public void addIndex(IndexDescriptor indexDesc, boolean isCovering, int numProjectedFields)
    • analyzePrefixMatches

      public void analyzePrefixMatches(IndexProperties indexProps)
      This method analyzes an index's columns and starting from the first column, checks which part of the filter condition matches that column. This process continues with subsequent columns. The goal is to identify the portion of the filter condition that match the prefix columns. If there are additional conditions that don't match prefix columns, that condition is set as a remainder condition.
      Parameters:
      indexProps -
    • getCandidateIndexes

      public void getCandidateIndexes(IndexConditionInfo.Builder infoBuilder, List<IndexGroup> coveringIndexes, List<IndexGroup> nonCoveringIndexes, List<IndexGroup> intersectIndexes)
      Run the index selection algorithm and return the top N indexes
    • getBestIndexNoFilter

      public IndexProperties getBestIndexNoFilter()
      we assume all the indexes added in indexPropList are all applicable (and covering). For now this function is used and tested only in IndexScanWithSortOnlyPrule