/**
   * Return the statement execution plan as a String.
   *
   * @param depth Indentation level.
   * @return String The statement execution plan as a String.
   */
  public String getStatementExecutionPlanText(int depth) {
    initFormatInfo(depth);

    return indent
        + MessageService.getTextMessage(SQLState.RTS_SCALAR_AGG_RS)
        + ":\n"
        + indent
        + MessageService.getTextMessage(SQLState.RTS_NUM_OPENS)
        + " = "
        + numOpens
        + "\n"
        + indent
        + MessageService.getTextMessage(SQLState.RTS_ROWS_INPUT)
        + " = "
        + rowsInput
        + "\n"
        + dumpTimeStats(indent, subIndent)
        + "\n"
        + dumpEstimatedCosts(subIndent)
        + "\n"
        + indent
        + MessageService.getTextMessage(SQLState.RTS_INDEX_KEY_OPT)
        + " = "
        + indexKeyOptimization
        + "\n"
        + indent
        + MessageService.getTextMessage(SQLState.RTS_SOURCE_RS)
        + ":\n"
        + childResultSetStatistics.getStatementExecutionPlanText(sourceDepth)
        + "\n";
  }
  public void accept(XPLAINVisitor visitor) {
    int noChildren = 0;
    if (this.childResultSetStatistics != null) noChildren++;

    // inform the visitor
    visitor.setNumberOfChildren(noChildren);

    // pre-order, depth-first traversal
    // me first
    visitor.visit(this);
    // then my child
    if (childResultSetStatistics != null) {
      childResultSetStatistics.accept(visitor);
    }
  }
 /**
  * Return information on the scan nodes from the statement execution plan as a String.
  *
  * @param depth Indentation level.
  * @param tableName if not NULL then print information for this table only
  * @return String The information on the scan nodes from the statement execution plan as a String.
  */
 public String getScanStatisticsText(String tableName, int depth) {
   return childResultSetStatistics.getScanStatisticsText(tableName, depth);
 }