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 RealNestedLoopLeftOuterJoinStatistics 42 extends RealNestedLoopJoinStatistics 43 { 44 45 46 public int emptyRightRowsReturned; 47 48 50 54 public RealNestedLoopLeftOuterJoinStatistics( 55 int numOpens, 56 int rowsSeen, 57 int rowsFiltered, 58 long constructorTime, 59 long openTime, 60 long nextTime, 61 long closeTime, 62 int resultSetNumber, 63 int rowsSeenLeft, 64 int rowsSeenRight, 65 int rowsReturned, 66 long restrictionTime, 67 double optimizerEstimatedRowCount, 68 double optimizerEstimatedCost, 69 String userSuppliedOptimizerOverrides, 70 ResultSetStatistics leftResultSetStatistics, 71 ResultSetStatistics rightResultSetStatistics, 72 int emptyRightRowsReturned 73 ) 74 { 75 super( 76 numOpens, 77 rowsSeen, 78 rowsFiltered, 79 constructorTime, 80 openTime, 81 nextTime, 82 closeTime, 83 resultSetNumber, 84 rowsSeenLeft, 85 rowsSeenRight, 86 rowsReturned, 87 restrictionTime, 88 false, optimizerEstimatedRowCount, 90 optimizerEstimatedCost, 91 userSuppliedOptimizerOverrides, 92 leftResultSetStatistics, 93 rightResultSetStatistics 94 ); 95 this.emptyRightRowsReturned = emptyRightRowsReturned; 96 } 97 98 100 107 public String getStatementExecutionPlanText(int depth) 108 { 109 initFormatInfo(depth); 110 111 return 112 indent + resultSetName + ":" + "\n" + 113 indent + MessageService.getTextMessage(SQLState.RTS_NUM_OPENS) + 114 " = " + numOpens + "\n" + 115 indent + MessageService.getTextMessage( 116 SQLState.RTS_ROWS_SEEN_LEFT) + 117 " = " + rowsSeenLeft + "\n" + 118 indent + MessageService.getTextMessage( 119 SQLState.RTS_ROWS_SEEN_RIGHT) + 120 " = " + rowsSeenRight + "\n" + 121 indent + MessageService.getTextMessage( 122 SQLState.RTS_EMPTY_RIGHT_ROWS) + 123 " = " + emptyRightRowsReturned + "\n" + 124 indent + MessageService.getTextMessage( 125 SQLState.RTS_ROWS_FILTERED) + 126 " = " + rowsFiltered + "\n" + 127 indent + MessageService.getTextMessage( 128 SQLState.RTS_ROWS_RETURNED) + 129 " = " + rowsReturned + "\n" + 130 dumpTimeStats(indent, subIndent) + "\n" + 131 dumpEstimatedCosts(subIndent) + "\n" + 132 indent + MessageService.getTextMessage( 133 SQLState.RTS_LEFT_RS) + 134 ":\n" + 135 leftResultSetStatistics.getStatementExecutionPlanText(sourceDepth) + 136 "\n" + 137 indent + MessageService.getTextMessage( 138 SQLState.RTS_RIGHT_RS) + 139 ":\n" + 140 rightResultSetStatistics.getStatementExecutionPlanText( 141 sourceDepth) + 142 "\n"; 143 } 144 145 155 public String getScanStatisticsText(String tableName, int depth) 156 { 157 return leftResultSetStatistics.getScanStatisticsText(tableName, depth) 158 + rightResultSetStatistics.getScanStatisticsText(tableName, depth); 159 } 160 161 163 public String toString() 164 { 165 return getStatementExecutionPlanText(0); 166 } 167 168 protected void setNames() 169 { 170 nodeName = MessageService.getTextMessage( 171 SQLState.RTS_NESTED_LOOP_LEFT_OJ); 172 resultSetName = MessageService.getTextMessage( 173 SQLState.RTS_NESTED_LOOP_LEFT_OJ_RS); 174 } 175 } 176 | Popular Tags |