system.query_optimization.join_graph module¶
Join graph model and factories for chain, star, cycle, and clique queries.
- class system.query_optimization.join_graph.JoinGraph(number_of_relations: int)[source]¶
Bases:
objectA join graph for a query. Internally, it uses an adjacency list to represent the graph.
- add_join(left_relation: int, right_relation: int)[source]¶
Adds a join between the left and the right relation. :param left_relation: The id of the left relation. :param right_relation: The id of the right relation.
- are_connected(left: Problem, right: Problem) bool[source]¶
Checks whether the left and right problem are connected. :param left: The left problem. :param right: The right problem. :return: True, if the problems are connected, False if not.
- class system.query_optimization.join_graph.JoinGraphFactory[source]¶
Bases:
ABCA simple, abstract factory class to create certain join graph schemes.
- class system.query_optimization.join_graph.ChainQueryFactory[source]¶
Bases:
JoinGraphFactoryCreates a chain query of the given size.
- static construct_join_graph(num_nodes: int) JoinGraph[source]¶
See
JoinGraphFactory.construct_join_graph().Builds a chain query, joining each relation
iwith relationi + 1.
- class system.query_optimization.join_graph.StarQueryFactory[source]¶
Bases:
JoinGraphFactoryCreates a star query of the given size.
- static construct_join_graph(num_nodes: int) JoinGraph[source]¶
See
JoinGraphFactory.construct_join_graph().Builds a star query, joining the fact table (relation
0) with every other relation.
- class system.query_optimization.join_graph.CycleQueryFactory[source]¶
Bases:
JoinGraphFactoryCreates a cycle query of the given size.
- static construct_join_graph(num_nodes: int) JoinGraph[source]¶
See
JoinGraphFactory.construct_join_graph().Builds a cycle query, i.e., a chain query with an additional edge closing the last relation back to the first.
- class system.query_optimization.join_graph.CliqueQueryFactory[source]¶
Bases:
JoinGraphFactoryCreates a clique query of the given size.
- static construct_join_graph(num_nodes: int) JoinGraph[source]¶
See
JoinGraphFactory.construct_join_graph().Builds a clique query, joining every relation with every relation (self-joins included).