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 RealOnceResultSetStatistics 42 extends RealNoPutResultSetStatistics 43 { 44 45 46 public int subqueryNumber; 47 public int pointOfAttachment; 48 public ResultSetStatistics childResultSetStatistics; 49 50 52 56 public RealOnceResultSetStatistics( 57 int numOpens, 58 int rowsSeen, 59 int rowsFiltered, 60 long constructorTime, 61 long openTime, 62 long nextTime, 63 long closeTime, 64 int resultSetNumber, 65 int subqueryNumber, 66 int pointOfAttachment, 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.subqueryNumber = subqueryNumber; 85 this.pointOfAttachment = pointOfAttachment; 86 this.childResultSetStatistics = childResultSetStatistics; 87 } 88 89 91 98 public String getStatementExecutionPlanText(int depth) 99 { 100 String attachmentString = (pointOfAttachment == -1) ? 101 ":" : 102 ( 103 MessageService.getTextMessage(SQLState.RTS_ATTACHED_TO) + 104 " " + 105 pointOfAttachment + 106 "):" 107 ); 108 initFormatInfo(depth); 109 110 return 111 indent + MessageService.getTextMessage( 112 SQLState.RTS_BEGIN_SQ_NUMBER) + 113 " " + subqueryNumber + "\n" + 114 indent + MessageService.getTextMessage(SQLState.RTS_ONCE_RS) + 115 attachmentString + "\n" + 116 indent + MessageService.getTextMessage(SQLState.RTS_NUM_OPENS) + 117 " = " + numOpens + "\n" + 118 indent + MessageService.getTextMessage(SQLState.RTS_ROWS_SEEN) + 119 " = " + rowsSeen + "\n" + 120 indent + MessageService.getTextMessage(SQLState.RTS_SOURCE_RS) + 121 ":\n" + 122 dumpTimeStats(indent, subIndent) + "\n" + 123 dumpEstimatedCosts(subIndent) + "\n" + 124 childResultSetStatistics.getStatementExecutionPlanText(sourceDepth) 125 + "\n" + 126 indent + MessageService.getTextMessage( 127 SQLState.RTS_END_SQ_NUMBER) + 128 " " + subqueryNumber + "\n"; 129 } 130 131 141 public String getScanStatisticsText(String tableName, int depth) 142 { 143 return childResultSetStatistics.getScanStatisticsText(tableName, depth); 144 } 145 146 148 public String toString() 149 { 150 return getStatementExecutionPlanText(0); 151 } 152 public java.util.Vector getChildren(){ 153 java.util.Vector children = new java.util.Vector (); 154 children.addElement(childResultSetStatistics); 155 return children; 156 } 157 161 public String getNodeName(){ 162 return MessageService.getTextMessage(SQLState.RTS_ONCE_RS); 163 } 164 } 165 | Popular Tags |