Class GenericPlanNode


  • @Experimental
    public class GenericPlanNode
    extends java.lang.Object
    This is an experimental feature. The interface may be changed, moved or potentially removed in a future release.

    The interface is used to implement query explanations (query plan)

    Since:
    3.2.0
    • Field Detail

      • uniqueIdPrefix

        private static final java.lang.String uniqueIdPrefix
      • uniqueIdSuffix

        private static final java.util.concurrent.atomic.AtomicLong uniqueIdSuffix
      • spoc

        private static final java.lang.String[] spoc
      • newLine

        private static final java.lang.String newLine
      • id

        private final java.lang.String id
      • type

        private java.lang.String type
      • timedOut

        private java.lang.Boolean timedOut
      • costEstimate

        private java.lang.Double costEstimate
      • resultSizeEstimate

        private java.lang.Double resultSizeEstimate
      • resultSizeActual

        private java.lang.Long resultSizeActual
      • totalTimeActual

        private java.lang.Double totalTimeActual
      • newScope

        private java.lang.Boolean newScope
      • algorithm

        private java.lang.String algorithm
    • Constructor Detail

      • GenericPlanNode

        public GenericPlanNode()
      • GenericPlanNode

        public GenericPlanNode​(java.lang.String type)
    • Method Detail

      • getType

        public java.lang.String getType()
      • setType

        public void setType​(java.lang.String type)
      • setPlans

        public void setPlans​(java.util.List<GenericPlanNode> plans)
      • getCostEstimate

        public java.lang.Double getCostEstimate()
        The cost estimate that the query planner calculated for this node. Value has no meaning outside of this explanation and is only used to compare and order the nodes in the query plan.
        Returns:
        a cost estimate as a double value
      • setCostEstimate

        public void setCostEstimate​(java.lang.Double costEstimate)
      • getResultSizeEstimate

        public java.lang.Double getResultSizeEstimate()
        The number of results that this node was estimated to produce.
        Returns:
        result size estimate
      • setResultSizeEstimate

        public void setResultSizeEstimate​(java.lang.Double resultSizeEstimate)
      • getResultSizeActual

        public java.lang.Long getResultSizeActual()
        The actual number of results that this node produced while the query was executed.
        Returns:
        number of results that this query produced
      • setResultSizeActual

        public void setResultSizeActual​(java.lang.Long resultSizeActual)
      • getTotalTimeActual

        public java.lang.Double getTotalTimeActual()
        The total time in milliseconds that this node-tree (all children and so on) used while the query was executed.
        Returns:
        time in milliseconds that was used to execute the query
      • setTotalTimeActual

        public void setTotalTimeActual​(java.lang.Double totalTimeActual)
      • setTimedOut

        public void setTimedOut​(java.lang.Boolean timedOut)
      • getTimedOut

        public java.lang.Boolean getTimedOut()
      • getSelfTimeActual

        public java.lang.Double getSelfTimeActual()
        The time that this node used by itself (eg. totalTimeActual - sum of plans[0..n].totalTimeActual)
      • isNewScope

        public java.lang.Boolean isNewScope()
        Returns:
        true if this node introduces a new scope
      • setNewScope

        public void setNewScope​(boolean newScope)
      • getAlgorithm

        public java.lang.String getAlgorithm()
        Join nodes can use various algorithms for joining data.
        Returns:
        the name of the algorithm.
      • setAlgorithm

        public void setAlgorithm​(java.lang.String algorithm)
      • toString

        public java.lang.String toString()
        Human readable string. Do not attempt to parse this.
        Overrides:
        toString in class java.lang.Object
        Returns:
        an unparsable string
      • getHumanReadable

        private java.lang.String getHumanReadable​(int prettyBoxDrawingType)
        Parameters:
        prettyBoxDrawingType - for deciding if we should use single or double walled character for drawing the connectors between nodes in the query plan. Eg. ├ or ╠ and ─ o
        Returns:
      • toHumanReadableNumber

        private static java.lang.String toHumanReadableNumber​(java.lang.Double number)
        Returns:
        Human readable number. Eg. 12.1M for 1212213.4 and UNKNOWN for -1.
      • toHumanReadableNumber

        private static java.lang.String toHumanReadableNumber​(java.lang.Long number)
        Returns:
        Human readable number. Eg. 12.1M for 1212213.4 and UNKNOWN for -1.
      • toHumanReadableTime

        private static java.lang.String toHumanReadableTime​(java.lang.Double millis)
        Returns:
        Human readable time.
      • appendCostAnnotation

        private void appendCostAnnotation​(java.lang.StringBuilder sb)
      • toDot

        public java.lang.String toDot()
      • getMaxTotalTime

        private static double getMaxTotalTime​(GenericPlanNode genericPlanNode)
      • getMaxSelfTime

        private static double getMaxSelfTime​(GenericPlanNode genericPlanNode)
      • getMaxResultSizeActual

        private static double getMaxResultSizeActual​(GenericPlanNode genericPlanNode)
      • toDotInternal

        private java.lang.String toDotInternal​(double maxResultSizeActual,
                                               double maxTotalTime,
                                               double maxSelfTime)
      • getProportionalRedColor

        private java.lang.String getProportionalRedColor​(java.lang.Double max,
                                                         java.lang.Double value)
      • getProportionalRedColor

        private java.lang.String getProportionalRedColor​(java.lang.Double max,
                                                         java.lang.Long value)
      • getID

        public java.lang.String getID()