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.FormatableBitSet; 30 import org.apache.derby.iapi.services.io.FormatableHashtable; 31 32 import java.io.ObjectOutput ; 33 import java.io.ObjectInput ; 34 import java.io.IOException ; 35 36 42 public class RealIndexRowToBaseRowStatistics 43 extends RealNoPutResultSetStatistics 44 { 45 46 47 public String tableName; 48 public ResultSetStatistics childResultSetStatistics; 49 public String colsAccessedFromHeap; 50 51 53 57 public RealIndexRowToBaseRowStatistics( 58 int numOpens, 59 int rowsSeen, 60 int rowsFiltered, 61 long constructorTime, 62 long openTime, 63 long nextTime, 64 long closeTime, 65 int resultSetNumber, 66 String tableName, 67 FormatableBitSet colsAccessedFromHeap, 68 double optimizerEstimatedRowCount, 69 double optimizerEstimatedCost, 70 ResultSetStatistics childResultSetStatistics 71 ) 72 { 73 super( 74 numOpens, 75 rowsSeen, 76 rowsFiltered, 77 constructorTime, 78 openTime, 79 nextTime, 80 closeTime, 81 resultSetNumber, 82 optimizerEstimatedRowCount, 83 optimizerEstimatedCost 84 ); 85 this.tableName = tableName; 86 this.colsAccessedFromHeap = (colsAccessedFromHeap == null) ? 87 "{" + 88 MessageService.getTextMessage( 89 SQLState.RTS_ALL) + 90 "}" : 91 colsAccessedFromHeap.toString(); 92 this.childResultSetStatistics = childResultSetStatistics; 93 } 94 95 97 104 public String getStatementExecutionPlanText(int depth) 105 { 106 initFormatInfo(depth); 107 108 return 109 indent + MessageService.getTextMessage( 110 SQLState.RTS_IRTBR_RS, 111 tableName) + 112 ":" + "\n" + 113 indent + MessageService.getTextMessage( 114 SQLState.RTS_NUM_OPENS) + 115 " = " + numOpens + "\n" + 116 indent + MessageService.getTextMessage( 117 SQLState.RTS_ROWS_SEEN) + 118 " = " + rowsSeen + "\n" + 119 indent + MessageService.getTextMessage( 120 SQLState.RTS_COLS_ACCESSED_FROM_HEAP) + 121 " = " + colsAccessedFromHeap + "\n" + 122 dumpTimeStats(indent, subIndent) + "\n" + 123 dumpEstimatedCosts(subIndent) + "\n" + 124 childResultSetStatistics.getStatementExecutionPlanText(sourceDepth) + "\n"; 125 } 126 127 137 public String getScanStatisticsText(String tableName, int depth) 138 { 139 if ((tableName == null) || 140 (tableName.equals(this.tableName))) 141 return getStatementExecutionPlanText(depth); 142 else 143 return (String )""; 144 } 145 146 147 149 public String toString() 150 { 151 return getStatementExecutionPlanText(0); 152 } 153 public java.util.Vector getChildren(){ 154 java.util.Vector children = new java.util.Vector (); 155 children.addElement(childResultSetStatistics); 156 return children; 157 } 158 159 164 public String getNodeOn(){ 165 return MessageService.getTextMessage( 166 SQLState.RTS_FOR_TAB_NAME, 167 tableName); 168 } 169 173 public String getNodeName(){ 174 return MessageService.getTextMessage(SQLState.RTS_IRTBR); 175 } 176 177 182 ResultSetStatistics getChildResultSetStatistics() 183 { 184 return childResultSetStatistics; 185 } 186 } 187 | Popular Tags |