system.query_optimization.cost_function module

The classic C_out join cost function implementation.

class system.query_optimization.cost_function.C_Out[source]

Bases: CostFunction

Implements the classic cost function C_out.

estimate_join_costs(left: Problem, right: Problem, cardinality_table: CardinalityTable, plan_table: PlanTable) → int[source]

See CostFunction.estimate_join_costs().

C_out variant: the join cost is the estimated output cardinality of the join plus the costs already accumulated for the left and right sub-problems.

estimate_filter_costs(problem: Problem, cardinality_table: CardinalityTable) → int[source]

See CostFunction.estimate_filter_costs().

C_out variant: the filter cost is the estimated cardinality of the (singleton) problem.