system.query_optimization.plan_table module

Plan table implementations for dynamic-programming join-order enumeration.

class system.query_optimization.plan_table.StandardPlanTable(join_graph: JoinGraph, cost_function: CostFunction, cardinality_table: CardinalityTable)[source]

Bases: PlanTable

A standard plan table used for enumeration. It stores for each problem the best costs and plan.

get_costs_for_problem(problem: Problem)[source]

See PlanTable.get_costs_for_problem().

get_plan_for_problem(problem: Problem)[source]

See PlanTable.get_plan_for_problem().

class system.query_optimization.plan_table.SizeBasedPlanTable(join_graph: JoinGraph, cost_function: CostFunction, cardinality_table: CardinalityTable)[source]

Bases: PlanTable

A plan table used for enumeration. It stores for each problem the best costs and plan. Unlike the StandardPlanTable, it orders problems based on their size to allow an efficient enumeration over them.

entries_with_size(k: int, start_index: int = 0)[source]

Returns an iterator to all elements with size k. :param k: The size to iterate through. :param start_index: The optional start index to iterate through. :return: An iterator to the list of problems with size k.

get_costs_for_problem(problem: Problem)[source]

See PlanTable.get_costs_for_problem().

get_plan_for_problem(problem: Problem)[source]

See PlanTable.get_plan_for_problem().