telepath / com.github.giedomak.telepath.cardinalityestimation / KPathIndexCardinalityEstimation / getCardinality

getCardinality

fun getCardinality(pathId: Long): Long (source)

Returns the cardinality of a given pathId using the StatisticsStore from our kPathIndex.

Parameters

pathId - The pathId of the path we want the cardinality for.

Return
The cardinality of the given pathId or 1 when non-existent.

fun getCardinality(physicalPlan: PhysicalPlan): Long (source)

Overrides CardinalityEstimation.getCardinality

Returns the cardinality of a given physicalPlan.

This method will recursively calculate the cardinality for its children in order to get the cardinality for the root.

Parameters

physicalPlan - The root of the tree for which we want to get the cardinality.

Return
The cardinality of the given physicalPlan.