code: private static boolean hasInnerOuterIndexExpression(String innerTableAlias,
                                                   Collection<AbstractExpression> indexExprs,
                                                   Collection<AbstractExpression> initialExpr,
                                                   Collection<AbstractExpression> endExprs)
      {
          HashSet<AbstractExpression> indexedExprs = new HashSet<>();
          indexedExprs.addAll(indexExprs);
          indexedExprs.addAll(initialExpr);
          indexedExprs.addAll(endExprs);
          // Find an outer TVE by ignoring any TVEs based on the inner table.
          for (AbstractExpression indexed : indexedExprs) {
              Collection<TupleValueExpression> indexedTVEs =
                      indexed.findAllTupleValueSubexpressions();
              for (AbstractExpression indexedTVExpr : indexedTVEs) {
                  if ( ! TupleValueExpression.isOperandDependentOnTable(indexedTVExpr, innerTableAlias)) {
                      return true;
                  }
              }
          }
          return false;
      }
docs: For a join node, determines whether any of the inner-outer expressions were used
  for an inner index access -- this requires joining with a NestLoopIndexJoin.
  These are detected as TVE references in the various clauses that drive the indexing
  -- as opposed to TVE references in post-filters that pose no problem with either
  NLIJ or the more efficient (one-pass through the index) NestLoopJoin.
  
  @param innerTable - the Table of all inner TVEs that are exempt from the check.
  @param indexExprs - a list of expressions used in the indexing
  @param initialExpr - a list of expressions used in the indexing
  @param endExprs - a list of expressions used in the indexing
  @return true if at least one of the expression lists references a TVE.