code: public boolean isValidExprForIndexesAndMVs(StringBuffer msg, boolean isMV) {
          if (containsFunctionById(FunctionSQL.voltGetCurrentTimestampId())) {
              msg.append("cannot include the function NOW or CURRENT_TIMESTAMP.");
              return false;
          } else if (hasAnySubexpressionOfClass(AggregateExpression.class)) {
              msg.append("cannot contain aggregate expressions.");
              return false;
          } else if (hasAnySubexpressionOfClass(AbstractSubqueryExpression.class)) {
              // There may not be any of these in HSQL1.9.3b.  However, in
              // HSQL2.3.2 subqueries are stored as expressions.  So, we may
              // find some here.  We will keep it here for the moment.
              if (isMV) {
                  msg.append("cannot contain subquery sources.");
              } else {
                  msg.append("cannot contain subqueries.");
              }
              return false;
          } else if (hasUserDefinedFunctionExpression()) {
              msg.append("cannot contain calls to user defined functions.");
              return false;
          } else {
              return true;
          }
      }
docs: Return true if the given expression usable as part of an index or MV's
  group by and where clause expression.
  If false, put the tail of an error message in the string buffer. The
  string buffer will be initialized with the name of the index.
  
  @param expr The expression to check
  @param msg  The StringBuffer to pack with the error message tail.
  @return true iff the expression can be part of an index.