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 RealAnyResultSetStatistics 42 extends RealNoPutResultSetStatistics 43 { 44 45 46 public int subqueryNumber; 47 public int pointOfAttachment; 48 public ResultSetStatistics childResultSetStatistics; 49 50 52 56 public RealAnyResultSetStatistics( 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 super( 72 numOpens, 73 rowsSeen, 74 rowsFiltered, 75 constructorTime, 76 openTime, 77 nextTime, 78 closeTime, 79 resultSetNumber, 80 optimizerEstimatedRowCount, 81 optimizerEstimatedCost 82 ); 83 this.subqueryNumber = subqueryNumber; 84 this.pointOfAttachment = pointOfAttachment; 85 this.childResultSetStatistics = childResultSetStatistics; 86 } 87 88 90 97 public String getStatementExecutionPlanText(int depth) 98 { 99 String attachmentString = (pointOfAttachment == -1) ? ":" : 100 (" (" + 101 MessageService.getTextMessage(SQLState.RTS_ATTACHED_TO) 102 + " " + pointOfAttachment + "):"); 103 initFormatInfo(depth); 104 105 return 106 indent + 107 MessageService.getTextMessage(SQLState.RTS_BEGIN_SQ_NUMBER) + 108 " " + subqueryNumber + "\n" + 109 indent + 110 MessageService.getTextMessage(SQLState.RTS_ANY_RS) + 111 " " + attachmentString + "\n" + 112 indent + 113 MessageService.getTextMessage(SQLState.RTS_NUM_OPENS) + 114 " = " + numOpens + "\n" + 115 indent + 116 MessageService.getTextMessage(SQLState.RTS_ROWS_SEEN) + 117 " = " + rowsSeen + "\n" + 118 dumpTimeStats(indent, subIndent) + "\n" + 119 dumpEstimatedCosts(subIndent) + "\n" + 120 indent + 121 MessageService.getTextMessage(SQLState.RTS_SOURCE_RS) + 122 ":\n" + 123 childResultSetStatistics.getStatementExecutionPlanText(sourceDepth) + "\n" + 124 indent + 125 MessageService.getTextMessage(SQLState.RTS_END_SQ_NUMBER) + 126 " " + subqueryNumber + "\n"; 127 } 128 129 139 public String getScanStatisticsText(String tableName, int depth) 140 { 141 return childResultSetStatistics.getScanStatisticsText(tableName, depth); 142 } 143 144 145 147 public String toString() 148 { 149 return getStatementExecutionPlanText(0); 150 } 151 public java.util.Vector getChildren(){ 152 java.util.Vector children = new java.util.Vector (); 153 children.addElement(childResultSetStatistics); 154 return children; 155 } 156 160 public String getNodeName(){ 161 return MessageService.getTextMessage(SQLState.RTS_ANY_RS); 162 } 163 } 164 | Popular Tags |