telepath / com.github.giedomak.telepath.datamodels.plans / PhysicalPlan

PhysicalPlan

class PhysicalPlan : AbstractMultiTree<PhysicalPlan> (source)

Representation of the physical plan.

This class extends AbstractMultiTree and and has physical operators instread of logical operators in comparison to the LogicalPlan class.

Constructors

<init>

PhysicalPlan(query: Query, leaf: Edge)

Directly construct a PhysicalPlan for the given leaf.

PhysicalPlan(query: Query, operator: Int = PhysicalOperator.LEAF)

Representation of the physical plan.

Properties

operator

var operator: Int

An Int representing the physical operator. See HASH_JOIN for an example.

operatorName

val operatorName: String?

This property gets the symbolic name String belonging to our operator, e.g. HASH_JOIN.

physicalOperator

val physicalOperator: PhysicalOperator?

The PhysicalOperator instance which corresponds to our operator.

Inherited Properties

children

var children: MutableList<ImplementingTree>

isLeaf

val isLeaf: Boolean

leaf

var leaf: Edge?

nodeRepresentation

val nodeRepresentation: String

query

val query: Query

Functions

cardinality

fun cardinality(): Long

The estimated cardinality of this physical plan.

cost

fun cost(): Long

Delegate costing of this physical plan to the costModel of the module.

merge

fun merge(tree: PhysicalPlan, operator: Int): PhysicalPlan

Merge this physical plan with another given physical plan through an operator.

pathIdOfChildren

fun pathIdOfChildren(): Long

Assuming we are an INDEX_LOOKUP, this will return the pathId belonging to the edges made up by our children.

Inherited Functions

clone

open fun clone(): ImplementingTree

Deep clone; also clone its children recusively.

equals

open fun equals(other: Any?): Boolean

flatten

fun flatten(): ImplementingTree

Delegate parse-tree-flattening to our MultiTreeFlattener.

getChild

fun getChild(index: Int): ImplementingTree?

Return the child at a given index or null when not existent.

hasChild

fun hasChild(index: Int): Boolean

Check if a child exists with index in our children list.

hashCode

open fun hashCode(): Int

height

fun height(): Int

Recursive function calculating the height of this tree.

postOrderTraversal

fun postOrderTraversal(): Sequence<ImplementingTree>

Post-order traversal.

print

fun print(): Unit

Delegate parse-tree-printing to our MultiTreePrinter.

setLeaf

fun setLeaf(label: String): Unit

Set the leaf by giving in a String which we'll convert to an Edge.

toString

open fun toString(): String