Top Description Fields Constructors Methods
org.apache.derby.impl.sql.execute.xplain

public Class XPLAINSystemTableVisitor

extends Object
implements XPLAINVisitor
Class Inheritance
All Implemented Interfaces
org.apache.derby.iapi.sql.execute.xplain.XPLAINVisitor
Imports
java.sql.Connection, .PreparedStatement, .SQLException, .Timestamp, java.util.ArrayList, .Iterator, .List, .Stack, org.apache.derby.catalog.UUID, org.apache.derby.iapi.jdbc.ConnectionContext, org.apache.derby.shared.common.error.StandardException, org.apache.derby.shared.common.info.JVMInfo, org.apache.derby.iapi.sql.Activation, org.apache.derby.iapi.sql.conn.LanguageConnectionContext, org.apache.derby.iapi.sql.dictionary.DataDictionary, org.apache.derby.impl.sql.catalog.XPLAINResultSetDescriptor, .XPLAINResultSetTimingsDescriptor, .XPLAINScanPropsDescriptor, .XPLAINSortPropsDescriptor, .XPLAINStatementDescriptor, .XPLAINStatementTimingsDescriptor, org.apache.derby.iapi.sql.execute.RunTimeStatistics, .ResultSetStatistics, org.apache.derby.iapi.sql.execute.xplain.XPLAINVisitor

This is the Visitor, which explains the information and stores the statistics in the system catalogs. It traverses the result set statistics tree and extracts the information.

Field Summary

Modifier and TypeField and Description
private Activation
private boolean
private DataDictionary
private LanguageConnectionContext
private boolean
private int
private List<XPLAINResultSetDescriptor>
private List<Object>
private List<XPLAINScanPropsDescriptor>
private List<XPLAINSortPropsDescriptor>
private XPLAINStatementDescriptor
private XPLAINStatementTimingsDescriptor
private UUID
private Stack<UUID>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private void
addArraysToSystemCatalogs()

This method writes the created descriptor arrays to the cooresponding system catalogs.

private void
addStmtDescriptorsToSystemCatalog()

This method writes only the stmt and its timing descriptor to the dataDictionary

private void
clean()

This method cleans up things after explanation.

public void
doXPLAIN(RunTimeStatistics rss, Activation activation)

Implements org.apache.derby.iapi.sql.execute.xplain.XPLAINVisitor.doXPLAIN.

the interface method, which gets called by the Top-ResultSet, which starts the tree traversal.

private Connection
getDefaultConn()

Open a nested Connection with which to execute INSERT statements.

private void
pushUUIDnoChildren(UUID
the UUID to push
uuid
)

helper method, which pushes the UUID, "number of Children" times onto the UUIDStack.

public void
reset()

Implements org.apache.derby.iapi.sql.execute.xplain.XPLAINVisitor.reset.

This method resets the visitor.

public void
setNumberOfChildren(int
the number of children of the current explained node.
noChildren
)

Implements org.apache.derby.iapi.sql.execute.xplain.XPLAINVisitor.setNumberOfChildren.

this method only stores the current number of children of the current explained node.

public void
visit(ResultSetStatistics
the statistics, which want to get explained.
statistics
)

Implements org.apache.derby.iapi.sql.execute.xplain.XPLAINVisitor.visit.

Visit this node, calling back to it to get details.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

activationback to summary
private Activation activation
considerTimingInformationback to summary
private boolean considerTimingInformation
ddback to summary
private DataDictionary dd
lccback to summary
private LanguageConnectionContext lcc
no_call_stmtsback to summary
private boolean no_call_stmts
noChildrenback to summary
private int noChildren
rsetsback to summary
private List<XPLAINResultSetDescriptor> rsets
rsetsTimingsback to summary
private List<Object> rsetsTimings
scanrsetsback to summary
private List<XPLAINScanPropsDescriptor> scanrsets
sortrsetsback to summary
private List<XPLAINSortPropsDescriptor> sortrsets
stmtback to summary
private XPLAINStatementDescriptor stmt
stmtTimingsback to summary
private XPLAINStatementTimingsDescriptor stmtTimings
stmtUUIDback to summary
private UUID stmtUUID
UUIDStackback to summary
private Stack<UUID> UUIDStack

Constructor Detail

XPLAINSystemTableVisitorback to summary
public XPLAINSystemTableVisitor()

Method Detail

addArraysToSystemCatalogsback to summary
private void addArraysToSystemCatalogs() throws StandardException, SQLException

This method writes the created descriptor arrays to the cooresponding system catalogs.

addStmtDescriptorsToSystemCatalogback to summary
private void addStmtDescriptorsToSystemCatalog() throws StandardException, SQLException

This method writes only the stmt and its timing descriptor to the dataDictionary

cleanback to summary
private void clean()

This method cleans up things after explanation. It frees kept resources and still holded references.

doXPLAINback to summary
public void doXPLAIN(RunTimeStatistics rss, Activation activation) throws StandardException

Implements org.apache.derby.iapi.sql.execute.xplain.XPLAINVisitor.doXPLAIN.

the interface method, which gets called by the Top-ResultSet, which starts the tree traversal.

getDefaultConnback to summary
private Connection getDefaultConn() throws SQLException

Open a nested Connection with which to execute INSERT statements.

pushUUIDnoChildrenback to summary
private void pushUUIDnoChildren(UUID uuid)

helper method, which pushes the UUID, "number of Children" times onto the UUIDStack.

Parameters
uuid:UUID

the UUID to push

resetback to summary
public void reset()

Implements org.apache.derby.iapi.sql.execute.xplain.XPLAINVisitor.reset.

This method resets the visitor. Gets called right before explanation to make sure all needed objects exist and are up to date and the lists are cleared

setNumberOfChildrenback to summary
public void setNumberOfChildren(int noChildren)

Implements org.apache.derby.iapi.sql.execute.xplain.XPLAINVisitor.setNumberOfChildren.

this method only stores the current number of children of the current explained node. The child nodes then can re-use this information.

Parameters
noChildren:int

Doc from org.apache.derby.iapi.sql.execute.xplain.XPLAINVisitor.setNumberOfChildren.

the number of children of the current explained node.

visitback to summary
public void visit(ResultSetStatistics statistics)

Implements org.apache.derby.iapi.sql.execute.xplain.XPLAINVisitor.visit.

Visit this node, calling back to it to get details. This method visits the RS Statisitcs node, calling back to the node to get detailed descriptor information about it.

Parameters
statistics:ResultSetStatistics

Doc from org.apache.derby.iapi.sql.execute.xplain.XPLAINVisitor.visit.

the statistics, which want to get explained.