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 RealScrollInsensitiveResultSetStatistics 42 extends RealNoPutResultSetStatistics 43 { 44 45 46 public ResultSetStatistics childResultSetStatistics; 47 public int numFromHashTable; 48 public int numToHashTable; 49 50 52 56 public RealScrollInsensitiveResultSetStatistics( 57 int numOpens, 58 int rowsSeen, 59 int rowsFiltered, 60 long constructorTime, 61 long openTime, 62 long nextTime, 63 long closeTime, 64 int numFromHashTable, 65 int numToHashTable, 66 int resultSetNumber, 67 double optimizerEstimatedRowCount, 68 double optimizerEstimatedCost, 69 ResultSetStatistics childResultSetStatistics 70 ) 71 { 72 super( 73 numOpens, 74 rowsSeen, 75 rowsFiltered, 76 constructorTime, 77 openTime, 78 nextTime, 79 closeTime, 80 resultSetNumber, 81 optimizerEstimatedRowCount, 82 optimizerEstimatedCost 83 ); 84 this.numFromHashTable = numFromHashTable; 85 this.numToHashTable = numToHashTable; 86 this.childResultSetStatistics = childResultSetStatistics; 87 } 88 89 91 98 public String getStatementExecutionPlanText(int depth) 99 { 100 initFormatInfo(depth); 101 102 return 103 indent + MessageService.getTextMessage( 104 SQLState.RTS_SCROLL_INSENSITIVE_RS) + 105 ":\n" + 106 indent + MessageService.getTextMessage(SQLState.RTS_NUM_OPENS) + 107 " = " + numOpens + "\n" + 108 indent + MessageService.getTextMessage(SQLState.RTS_ROWS_SEEN) + 109 " = " + rowsSeen + "\n" + 110 indent + MessageService.getTextMessage( 111 SQLState.RTS_READS_FROM_HASH) + 112 " = " + numFromHashTable + "\n" + 113 indent + MessageService.getTextMessage( 114 SQLState.RTS_WRITES_TO_HASH) + 115 " = " + numToHashTable + "\n" + 116 dumpTimeStats(indent, subIndent) + "\n" + 117 dumpEstimatedCosts(subIndent) + "\n" + 118 indent + MessageService.getTextMessage(SQLState.RTS_SOURCE_RS) + 119 ":\n" + 120 childResultSetStatistics.getStatementExecutionPlanText( 121 sourceDepth) + 122 "\n"; 123 } 124 125 135 public String getScanStatisticsText(String tableName, int depth) 136 { 137 return childResultSetStatistics.getScanStatisticsText(tableName, depth); 138 } 139 140 142 public String toString() 143 { 144 return getStatementExecutionPlanText(0); 145 } 146 public java.util.Vector getChildren(){ 147 java.util.Vector children = new java.util.Vector (); 148 children.addElement(childResultSetStatistics); 149 return children; 150 } 151 155 public String getNodeName(){ 156 return MessageService.getTextMessage(SQLState.RTS_SCROLL_INSENSITIVE_RS); 157 } 158 } 159 | Popular Tags |