1 21 22 package org.apache.derby.impl.sql.execute.rts; 23 24 import org.apache.derby.iapi.services.io.StoredFormatIds; 25 26 import org.apache.derby.iapi.services.i18n.MessageService; 27 import org.apache.derby.iapi.reference.SQLState; 28 29 import org.apache.derby.iapi.services.io.FormatableHashtable; 30 31 import java.io.ObjectOutput ; 32 import java.io.ObjectInput ; 33 import java.io.IOException ; 34 35 41 public class RealNormalizeResultSetStatistics 42 extends RealNoPutResultSetStatistics 43 { 44 45 46 public ResultSetStatistics childResultSetStatistics; 47 48 50 54 public RealNormalizeResultSetStatistics( 55 int numOpens, 56 int rowsSeen, 57 int rowsFiltered, 58 long constructorTime, 59 long openTime, 60 long nextTime, 61 long closeTime, 62 int resultSetNumber, 63 double optimizerEstimatedRowCount, 64 double optimizerEstimatedCost, 65 ResultSetStatistics childResultSetStatistics 66 ) 67 { 68 super( 69 numOpens, 70 rowsSeen, 71 rowsFiltered, 72 constructorTime, 73 openTime, 74 nextTime, 75 closeTime, 76 resultSetNumber, 77 optimizerEstimatedRowCount, 78 optimizerEstimatedCost 79 ); 80 this.childResultSetStatistics = childResultSetStatistics; 81 } 82 83 85 92 public String getStatementExecutionPlanText(int depth) 93 { 94 initFormatInfo(depth); 95 96 return 97 indent + MessageService.getTextMessage( 98 SQLState.RTS_NORMALIZE_RS) + 99 ":\n" + 100 indent + MessageService.getTextMessage(SQLState.RTS_NUM_OPENS) + 101 " = " + numOpens + "\n" + 102 indent + MessageService.getTextMessage(SQLState.RTS_ROWS_SEEN) + 103 " = " + rowsSeen + "\n" + 104 dumpTimeStats(indent, subIndent) + "\n" + 105 dumpEstimatedCosts(subIndent) + "\n" + 106 indent + MessageService.getTextMessage(SQLState.RTS_SOURCE_RS) + 107 ":\n" + 108 childResultSetStatistics.getStatementExecutionPlanText( 109 sourceDepth) + 110 "\n"; 111 } 112 113 123 public String getScanStatisticsText(String tableName, int depth) 124 { 125 return childResultSetStatistics.getScanStatisticsText(tableName, depth); 126 } 127 128 130 public String toString() 131 { 132 return getStatementExecutionPlanText(0); 133 } 134 public java.util.Vector getChildren(){ 135 java.util.Vector children = new java.util.Vector (); 136 children.addElement(childResultSetStatistics); 137 return children; 138 } 139 143 public String getNodeName(){ 144 return MessageService.getTextMessage(SQLState.RTS_NORMALIZE_RS); 145 } 146 } 147 | Popular Tags |