core/src/main/java/com/orientechnologies/orient/core/sql/executor/OSelectExecutionPlanner.java
private boolean isPrefixOf(IndexSearchDescriptor item, IndexSearchDescriptor desc) {
    List<OBooleanExpression> left = item.keyCondition.getSubBlocks();
    List<OBooleanExpression> right = desc.keyCondition.getSubBlocks();
    if (left.size() > right.size()) {
      return false;
    }
    for (int i = 0; i < left.size(); i++) {
      if (!left.get(i).equals(right.get(i))) {
        return false;
      }
    }
    return true;
  }
private boolean isPrefixOf(IndexSearchDescriptor item, IndexSearchDescriptor desc) {
    List<OBooleanExpression> left = item.keyCondition.getSubBlocks();
    List<OBooleanExpression> right = desc.keyCondition.getSubBlocks();
    if (left.size() > right.size()) {
      return false;
    }
    for (int i = 0; i < left.size(); i++) {
      if (!left.get(i).equals(right.get(i))) {
        return false;
      }
    }
    return true;
  }
returns true if the first argument is a prefix for the second argument, eg. if the first argument is [a] and the second
argument is [a, b]

@param item
@param desc

@return