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 RealUnionResultSetStatistics 42 extends RealNoPutResultSetStatistics 43 { 44 45 46 public int rowsSeenLeft; 47 public int rowsSeenRight; 48 public int rowsReturned; 49 public ResultSetStatistics leftResultSetStatistics; 50 public ResultSetStatistics rightResultSetStatistics; 51 52 54 58 public RealUnionResultSetStatistics( 59 int numOpens, 60 int rowsSeen, 61 int rowsFiltered, 62 long constructorTime, 63 long openTime, 64 long nextTime, 65 long closeTime, 66 int resultSetNumber, 67 int rowsSeenLeft, 68 int rowsSeenRight, 69 int rowsReturned, 70 double optimizerEstimatedRowCount, 71 double optimizerEstimatedCost, 72 ResultSetStatistics leftResultSetStatistics, 73 ResultSetStatistics rightResultSetStatistics 74 ) 75 { 76 super( 77 numOpens, 78 rowsSeen, 79 rowsFiltered, 80 constructorTime, 81 openTime, 82 nextTime, 83 closeTime, 84 resultSetNumber, 85 optimizerEstimatedRowCount, 86 optimizerEstimatedCost 87 ); 88 this.rowsSeenLeft = rowsSeenLeft; 89 this.rowsSeenRight = rowsSeenRight; 90 this.rowsReturned = rowsReturned; 91 this.leftResultSetStatistics = leftResultSetStatistics; 92 this.rightResultSetStatistics = rightResultSetStatistics; 93 } 94 95 97 104 public String getStatementExecutionPlanText(int depth) 105 { 106 initFormatInfo(depth); 107 108 return 109 indent + MessageService.getTextMessage(SQLState.RTS_UNION_RS) + 110 ":\n" + 111 indent + MessageService.getTextMessage(SQLState.RTS_NUM_OPENS) + 112 " = " + numOpens + "\n" + 113 indent + MessageService.getTextMessage( 114 SQLState.RTS_ROWS_SEEN_LEFT) + 115 " = " + rowsSeenLeft + "\n" + 116 indent + MessageService.getTextMessage( 117 SQLState.RTS_ROWS_SEEN_RIGHT) + 118 " = " + rowsSeenRight + "\n" + 119 indent + MessageService.getTextMessage( 120 SQLState.RTS_ROWS_RETURNED) + 121 " = " + rowsReturned + "\n" + 122 dumpTimeStats(indent, subIndent) + "\n" + 123 dumpEstimatedCosts(subIndent) + "\n" + 124 indent + MessageService.getTextMessage(SQLState.RTS_LEFT_RS) + 125 ":\n" + 126 leftResultSetStatistics.getStatementExecutionPlanText(sourceDepth) + 127 "\n" + 128 indent + MessageService.getTextMessage(SQLState.RTS_RIGHT_RS) + 129 ":\n" + 130 rightResultSetStatistics.getStatementExecutionPlanText( 131 sourceDepth) + 132 "\n"; 133 } 134 135 145 public String getScanStatisticsText(String tableName, int depth) 146 { 147 return leftResultSetStatistics.getScanStatisticsText(tableName, depth) 148 + rightResultSetStatistics.getScanStatisticsText(tableName, depth); 149 } 150 151 152 154 public String toString() 155 { 156 return getStatementExecutionPlanText(0); 157 } 158 public java.util.Vector getChildren(){ 159 java.util.Vector children = new java.util.Vector (); 160 children.addElement(leftResultSetStatistics); 161 children.addElement(rightResultSetStatistics); 162 return children; 163 } 164 168 public String getNodeName(){ 169 return MessageService.getTextMessage(SQLState.RTS_UNION); 170 } 171 } 172 | Popular Tags |