1 21 22 package org.apache.derby.impl.sql.execute.rts; 23 24 import org.apache.derby.iapi.services.i18n.MessageService; 25 import org.apache.derby.iapi.reference.SQLState; 26 27 33 public class RealDeleteResultSetStatistics 34 extends RealNoRowsResultSetStatistics 35 { 36 37 38 public int rowCount; 39 public boolean deferred; 40 public boolean tableLock; 41 public int indexesUpdated; 42 43 48 public RealDeleteResultSetStatistics( 49 int rowCount, 50 boolean deferred, 51 int indexesUpdated, 52 boolean tableLock, 53 long executeTime, 54 ResultSetStatistics sourceResultSetStatistics 55 ) 56 { 57 super(executeTime, sourceResultSetStatistics); 58 this.rowCount = rowCount; 59 this.deferred = deferred; 60 this.indexesUpdated = indexesUpdated; 61 this.tableLock = tableLock; 62 this.sourceResultSetStatistics = sourceResultSetStatistics; 63 } 64 65 67 74 public String getStatementExecutionPlanText(int depth) 75 { 76 77 initFormatInfo(depth); 78 79 80 return 81 indent + 82 MessageService.getTextMessage(SQLState.RTS_DELETE_RS_USING) + 83 " " + 84 MessageService.getTextMessage( 85 ((tableLock) ? 86 SQLState.RTS_TABLE_LOCKING : SQLState.RTS_ROW_LOCKING)) 87 + ":\n" + 88 indent + MessageService.getTextMessage(SQLState.RTS_DEFERRED) + 89 ": " + deferred + "\n" + 90 indent + 91 MessageService.getTextMessage(SQLState.RTS_ROWS_DELETED) + 92 " = " + rowCount + "\n" + 93 indent + 94 MessageService.getTextMessage(SQLState.RTS_INDEXES_UPDATED) + 95 " = " + indexesUpdated + "\n" + 96 dumpTimeStats(indent) + ((sourceResultSetStatistics == null) ? "" : 97 sourceResultSetStatistics.getStatementExecutionPlanText(1)); 98 } 99 100 109 public String getScanStatisticsText(String tableName, int depth) 110 { 111 if (sourceResultSetStatistics == null) 112 return ""; 113 114 return sourceResultSetStatistics.getScanStatisticsText(tableName, depth); 115 } 116 117 119 public String toString() 120 { 121 return getStatementExecutionPlanText(0); 122 } 123 127 public String getNodeName(){ 128 return MessageService.getTextMessage(SQLState.RTS_DELETE); 129 } 130 } 131 | Popular Tags |