Interface XPLAINVisitor

  • All Known Implementing Classes:
    XPLAINDefaultVisitor, XPLAINSystemTableVisitor

    public interface XPLAINVisitor
    Classes, which implement this interface have the ability to explain the gathered ResultSetStatistics. A Visitor pattern is used to traverse the ResultSetStatistics tree and to extract the required information. Classes implementing this interface are responsible about what they extract and what will be done with the extracted information. This approach allows easy representaion extensions of the statistics, e.g. an XML representation.
    • Method Detail

      • reset

        void reset()
        Call this method to reset the visitor for a new run over the statistics. A default implementation should call this method automatically at first of a call of doXPLAIN().
      • doXPLAIN

        void doXPLAIN​(RunTimeStatistics rss,
                      Activation activation)
               throws StandardException
        This method is the hook method which is called from the TopResultSet. It starts the explanation of the current ResultSetStatistics tree and keeps the information during one explain run.
        Throws:
        StandardException
      • visit

        void visit​(ResultSetStatistics statistics)
        This is the Visitor hook method, which gets called from each ResultSetStatistics. It depends on the sub-class implementation of this interface, to describe the behaviour of the explanation facility.
        To be easily extendable with new explain representation methods, just implement this interface and provide the new behaviour.
        Parameters:
        statistics - the statistics, which want to get explained.
      • setNumberOfChildren

        void setNumberOfChildren​(int noChildren)
        This method informs the visitor about the number of children. It has to be called first! by the different explainable nodes before the visit method of the visitor gets called. Each node knows how many children he has. The visitor can use this information to resolve the relationship of the current explained node to above nodes. Due to the top-down, pre-order, depth-first traversal of the tree, this information can directly be exploited.
        Parameters:
        noChildren - the number of children of the current explained node.