system.query_optimization.cardinality_table module

Cardinality table storing and estimating relation and join cardinalities.

class system.query_optimization.cardinality_table.CardinalityTable[source]

Bases: object

A simple cardinality table used to store cardinalities for problems. Normally, cardinalities are obtained by using system statistics to make an estimation about the sizes of the results.

get_cardinality_estimation(problem: Problem) → int[source]

Returns the cardinality estimation for the problem. :param problem: The problem. :return: The cardinality for the problem.

update_cardinality_estimation(problem: Problem, cardinality: int)[source]

Updates the cardinality estimation of the problem to the given cardinality. :param problem: The problem. :param cardinality: The cardinality.

estimate_join_cardinality(left: Problem, right: Problem) → int[source]

Returns the join cardinality estimation for the left and right problem. :param left: The left problem. :param right: The right problem. :return: The join cardinality of the left and right problem.