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 36 42 public class RealVTIStatistics 43 extends RealNoPutResultSetStatistics 44 { 45 46 47 48 public String javaClassName; 49 50 55 public RealVTIStatistics( 56 int numOpens, 57 int rowsSeen, 58 int rowsFiltered, 59 long constructorTime, 60 long openTime, 61 long nextTime, 62 long closeTime, 63 int resultSetNumber, 64 String javaClassName, 65 double optimizerEstimatedRowCount, 66 double optimizerEstimatedCost 67 ) 68 { 69 super( 70 numOpens, 71 rowsSeen, 72 rowsFiltered, 73 constructorTime, 74 openTime, 75 nextTime, 76 closeTime, 77 resultSetNumber, 78 optimizerEstimatedRowCount, 79 optimizerEstimatedCost 80 ); 81 this.javaClassName = javaClassName; 82 } 83 84 86 93 public String getStatementExecutionPlanText(int depth) 94 { 95 String header; 96 97 initFormatInfo(depth); 98 99 header = indent + MessageService.getTextMessage( 100 SQLState.RTS_VTI_RS, 101 javaClassName) + 102 ":\n"; 103 104 return 105 header + 106 indent + MessageService.getTextMessage(SQLState.RTS_NUM_OPENS) + 107 " = " + numOpens + "\n" + 108 indent + MessageService.getTextMessage(SQLState.RTS_ROWS_SEEN) + 109 " = " + rowsSeen + "\n" + 110 dumpTimeStats(indent, subIndent) + "\n" + 111 dumpEstimatedCosts(subIndent); 112 } 113 114 124 public String getScanStatisticsText(String tableName, int depth) 125 { 126 return getStatementExecutionPlanText(depth); 127 } 128 129 131 public String toString() 132 { 133 return getStatementExecutionPlanText(0); 134 } 135 136 141 public String getNodeOn(){ 142 return MessageService.getTextMessage( 143 SQLState.RTS_ON, 144 javaClassName); 145 } 146 150 public String getNodeName(){ 151 return MessageService.getTextMessage(SQLState.RTS_VTI); 152 } 153 } 154 | Popular Tags |