Top Description Methods
org.apache.derby.iapi.sql.execute

public Interface RunTimeStatistics

Known Direct Implementers
org.apache.derby.impl.sql.execute.rts.RunTimeStatisticsImpl
Imports
java.io.Serializable, java.sql.Time, .Timestamp, org.apache.derby.iapi.sql.execute.xplain.XPLAINVisitor

A RunTimeStatistics object is a representation of the query execution plan and run time statistics for a java.sql.ResultSet. A query execution plan is a tree of execution nodes. There are a number of possible node types. Statistics are accumulated during execution at each node. The types of statistics include the amount of time spent in specific operations (if STATISTICS TIMING is SET ON), the number of rows passed to the node by its child(ren) and the number of rows returned by the node to its parent. (The exact statistics are specific to each node type.)

RunTimeStatistics is most meaningful for DML statements (SELECT, INSERT, DELETE and UPDATE).

Method Summary

Modifier and TypeMethod and Description
public void
acceptFromTopResultSet(XPLAINVisitor
the visitor that wishes to visit the tree.
v
)

Initiate a visit of the ResultSetStatistics tree from the top.

public Timestamp

Returns:

The timestamp for the beginning of query compilation.
getBeginCompilationTimestamp
()

Get the timestamp for the beginning of query compilation.

public Timestamp

Returns:

The timestamp for the beginning of query execution.
getBeginExecutionTimestamp
()

Get the timestamp for the beginning of query execution.

public long

Returns:

The bind time for the associated query in milliseconds.
getBindTimeInMillis
()

Get the bind time for the associated query in milliseconds.

public long

Returns:

The total compile time for the associated query in milliseconds.
getCompileTimeInMillis
()

Get the total compile time for the associated query in milliseconds.

public Timestamp

Returns:

The timestamp for the end of query compilation.
getEndCompilationTimestamp
()

Get the timestamp for the end of query compilation.

public Timestamp

Returns:

The timestamp for the end of query execution.
getEndExecutionTimestamp
()

Get the timestamp for the end of query execution.

public double

Returns:

The estimated number of rows returned by the associated query or statement.
getEstimatedRowCount
()

Get the estimated row count for the number of rows returned by the associated query or statement.

public long

Returns:

The execute time for the associated query in milliseconds.
getExecuteTimeInMillis
()

Get the execute time for the associated query in milliseconds.

public long

Returns:

The generate time for the associated query in milliseconds.
getGenerateTimeInMillis
()

Get the generate time for the associated query in milliseconds.

public long

Returns:

The optimize time for the associated query in milliseconds.
getOptimizeTimeInMillis
()

Get the optimize time for the associated query in milliseconds.

public long

Returns:

The parse time for the associated query in milliseconds.
getParseTimeInMillis
()

Get the parse time for the associated query in milliseconds.

public String

Returns:

The nodes relating to table and index scans from the execution plan for the associated query or statement.
getScanStatisticsText
()

Get a String representation of the information on the nodes relating to table and index scans from the execution plan for the associated query or statement.

public String

Returns:

The nodes relating to table and index scans from the execution plan for the associated query or statement.
getScanStatisticsText
(String
The table for which user desires statistics.

tableName
)

Get a String representation of the information on the nodes relating to table and index scans from the execution plan for the associated query or statement for a particular table.

public String

Returns:

The Stored Prepared Statement name of the associated statement, or null if it is not an EXECUTE STATEMENT statement.
getSPSName
()

Get the name of the Stored Prepared Statement used for the statement.

public String

Returns:

The execution plan for the associated query or statement.
getStatementExecutionPlanText
()

Get a String representation of the execution plan for the associated query or statement.

public String

Returns:

The name of the associated query or statement.
getStatementName
()

Get the name of the associated query or statement.

public String

Returns:

The text for the associated query or statement.
getStatementText
()

Get the text for the associated query or statement.

Method Detail

acceptFromTopResultSetback to summary
public void acceptFromTopResultSet(XPLAINVisitor v)

Initiate a visit of the ResultSetStatistics tree from the top.

Parameters
v:XPLAINVisitor

the visitor that wishes to visit the tree.

getBeginCompilationTimestampback to summary
public Timestamp getBeginCompilationTimestamp()

Get the timestamp for the beginning of query compilation.

A null is returned if STATISTICS TIMING is not SET ON.

Returns:Timestamp

The timestamp for the beginning of query compilation.

getBeginExecutionTimestampback to summary
public Timestamp getBeginExecutionTimestamp()

Get the timestamp for the beginning of query execution.

A null is returned if STATISTICS TIMING is not SET ON.

Returns:Timestamp

The timestamp for the beginning of query execution.

getBindTimeInMillisback to summary
public long getBindTimeInMillis()

Get the bind time for the associated query in milliseconds.

Returns:long

The bind time for the associated query in milliseconds.

getCompileTimeInMillisback to summary
public long getCompileTimeInMillis()

Get the total compile time for the associated query in milliseconds. Compile time can be divided into parse, bind, optimize and generate times.

0 is returned if STATISTICS TIMING is not SET ON.

Returns:long

The total compile time for the associated query in milliseconds.

getEndCompilationTimestampback to summary
public Timestamp getEndCompilationTimestamp()

Get the timestamp for the end of query compilation.

A null is returned if STATISTICS TIMING is not SET ON.

Returns:Timestamp

The timestamp for the end of query compilation.

getEndExecutionTimestampback to summary
public Timestamp getEndExecutionTimestamp()

Get the timestamp for the end of query execution.

A null is returned if STATISTICS TIMING is not SET ON.

Returns:Timestamp

The timestamp for the end of query execution.

getEstimatedRowCountback to summary
public double getEstimatedRowCount()

Get the estimated row count for the number of rows returned by the associated query or statement.

Returns:double

The estimated number of rows returned by the associated query or statement.

getExecuteTimeInMillisback to summary
public long getExecuteTimeInMillis()

Get the execute time for the associated query in milliseconds.

0 is returned if STATISTICS TIMING is not SET ON.

Returns:long

The execute time for the associated query in milliseconds.

getGenerateTimeInMillisback to summary
public long getGenerateTimeInMillis()

Get the generate time for the associated query in milliseconds.

0 is returned if STATISTICS TIMING is not SET ON.

Returns:long

The generate time for the associated query in milliseconds.

getOptimizeTimeInMillisback to summary
public long getOptimizeTimeInMillis()

Get the optimize time for the associated query in milliseconds.

0 is returned if STATISTICS TIMING is not SET ON.

Returns:long

The optimize time for the associated query in milliseconds.

getParseTimeInMillisback to summary
public long getParseTimeInMillis()

Get the parse time for the associated query in milliseconds.

0 is returned if STATISTICS TIMING is not SET ON.

Returns:long

The parse time for the associated query in milliseconds.

getScanStatisticsTextback to summary
public String getScanStatisticsText()

Get a String representation of the information on the nodes relating to table and index scans from the execution plan for the associated query or statement.

Returns:String

The nodes relating to table and index scans from the execution plan for the associated query or statement.

getScanStatisticsTextback to summary
public String getScanStatisticsText(String tableName)

Get a String representation of the information on the nodes relating to table and index scans from the execution plan for the associated query or statement for a particular table.

Parameters
tableName:String

The table for which user desires statistics.

Returns:String

The nodes relating to table and index scans from the execution plan for the associated query or statement.

getSPSNameback to summary
public String getSPSName()

Get the name of the Stored Prepared Statement used for the statement. This method returns a value only for EXECUTE STATEMENT statements; otherwise, returns null.

Note that the name is returned in the schema.name format (e.g. APP.MYSTMT).

Returns:String

The Stored Prepared Statement name of the associated statement, or null if it is not an EXECUTE STATEMENT statement.

getStatementExecutionPlanTextback to summary
public String getStatementExecutionPlanText()

Get a String representation of the execution plan for the associated query or statement.

Returns:String

The execution plan for the associated query or statement.

getStatementNameback to summary
public String getStatementName()

Get the name of the associated query or statement. (This will be an internally generated name if the user did not assign a name.)

Returns:String

The name of the associated query or statement.

getStatementTextback to summary
public String getStatementText()

Get the text for the associated query or statement.

Returns:String

The text for the associated query or statement.