Class XPLAINSystemTableVisitor
- java.lang.Object
-
- org.apache.derby.impl.sql.execute.xplain.XPLAINSystemTableVisitor
-
- All Implemented Interfaces:
XPLAINVisitor
public class XPLAINSystemTableVisitor extends java.lang.Object implements 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
Fields Modifier and Type Field Description private Activationactivationprivate booleanconsiderTimingInformationprivate DataDictionaryddprivate LanguageConnectionContextlccprivate booleanno_call_stmtsprivate intnoChildrenprivate java.util.List<XPLAINResultSetDescriptor>rsetsprivate java.util.List<java.lang.Object>rsetsTimingsprivate java.util.List<XPLAINScanPropsDescriptor>scanrsetsprivate java.util.List<XPLAINSortPropsDescriptor>sortrsetsprivate XPLAINStatementDescriptorstmtprivate XPLAINStatementTimingsDescriptorstmtTimingsprivate UUIDstmtUUIDprivate java.util.Stack<UUID>UUIDStack
-
Constructor Summary
Constructors Constructor Description XPLAINSystemTableVisitor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidaddArraysToSystemCatalogs()This method writes the created descriptor arrays to the cooresponding system catalogs.private voidaddStmtDescriptorsToSystemCatalog()This method writes only the stmt and its timing descriptor to the dataDictionaryprivate voidclean()This method cleans up things after explanation.voiddoXPLAIN(RunTimeStatistics rss, Activation activation)the interface method, which gets called by the Top-ResultSet, which starts the tree traversal.private java.sql.ConnectiongetDefaultConn()Open a nested Connection with which to execute INSERT statements.private voidpushUUIDnoChildren(UUID uuid)helper method, which pushes the UUID, "number of Children" times onto the UUIDStack.voidreset()This method resets the visitor.voidsetNumberOfChildren(int noChildren)this method only stores the current number of children of the current explained node.voidvisit(ResultSetStatistics statistics)Visit this node, calling back to it to get details.
-
-
-
Field Detail
-
no_call_stmts
private boolean no_call_stmts
-
lcc
private LanguageConnectionContext lcc
-
dd
private DataDictionary dd
-
activation
private Activation activation
-
considerTimingInformation
private boolean considerTimingInformation
-
stmt
private XPLAINStatementDescriptor stmt
-
stmtTimings
private XPLAINStatementTimingsDescriptor stmtTimings
-
stmtUUID
private UUID stmtUUID
-
rsets
private java.util.List<XPLAINResultSetDescriptor> rsets
-
rsetsTimings
private java.util.List<java.lang.Object> rsetsTimings
-
sortrsets
private java.util.List<XPLAINSortPropsDescriptor> sortrsets
-
scanrsets
private java.util.List<XPLAINScanPropsDescriptor> scanrsets
-
noChildren
private int noChildren
-
UUIDStack
private java.util.Stack<UUID> UUIDStack
-
-
Method Detail
-
pushUUIDnoChildren
private void pushUUIDnoChildren(UUID uuid)
helper method, which pushes the UUID, "number of Children" times onto the UUIDStack.- Parameters:
uuid- the UUID to push
-
setNumberOfChildren
public void setNumberOfChildren(int noChildren)
this method only stores the current number of children of the current explained node. The child nodes then can re-use this information.- Specified by:
setNumberOfChildrenin interfaceXPLAINVisitor- Parameters:
noChildren- the number of children of the current explained node.
-
visit
public void visit(ResultSetStatistics statistics)
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.- Specified by:
visitin interfaceXPLAINVisitor- Parameters:
statistics- the statistics, which want to get explained.
-
reset
public void 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- Specified by:
resetin interfaceXPLAINVisitor
-
doXPLAIN
public void doXPLAIN(RunTimeStatistics rss, Activation activation) throws StandardException
the interface method, which gets called by the Top-ResultSet, which starts the tree traversal.- Specified by:
doXPLAINin interfaceXPLAINVisitor- Throws:
StandardException
-
clean
private void clean()
This method cleans up things after explanation. It frees kept resources and still holded references.
-
getDefaultConn
private java.sql.Connection getDefaultConn() throws java.sql.SQLExceptionOpen a nested Connection with which to execute INSERT statements.- Throws:
java.sql.SQLException
-
addStmtDescriptorsToSystemCatalog
private void addStmtDescriptorsToSystemCatalog() throws StandardException, java.sql.SQLExceptionThis method writes only the stmt and its timing descriptor to the dataDictionary- Throws:
StandardExceptionjava.sql.SQLException
-
addArraysToSystemCatalogs
private void addArraysToSystemCatalogs() throws StandardException, java.sql.SQLExceptionThis method writes the created descriptor arrays to the cooresponding system catalogs.- Throws:
StandardExceptionjava.sql.SQLException
-
-