Re: What's the necessity of the HepRelVertex used in HepPlanner

2024-02-21 Thread Julian Hyde
Let’s suppose that the information in HepRelVertex could somehow be moved into the RelNode. (Since the data structure is a DAG it seems plausible.) Now each RelNode would contain mutable state that relates to the HEP planner’s algorithm. That state needs to be managed (e.g. reinitialized when

Re: What's the necessity of the HepRelVertex used in HepPlanner

2024-02-20 Thread Alessandro Solimando
Hi Ayaka, I agree with Benchao, you can look at this article to get a sense on why a data structure allowing node substitution is useful in query planning: https://www.querifylabs.com/blog/memoization-in-cost-based-optimizers Best regards, Alessandro On Wed, 21 Feb 2024 at 05:55, Benchao Li

Re: What's the necessity of the HepRelVertex used in HepPlanner

2024-02-20 Thread Benchao Li
Ayaka, Per my understanding, HepRelVertex is used to make RelNode changeable easily, you can see more about HepRelVertex#replaceRel, it is used to change one RelNode to another after some rules applied and new equal node produced. In this way, we can easily change subgraphs of the original DAG

What's the necessity of the HepRelVertex used in HepPlanner

2024-02-19 Thread Ayaka Kamisato
I'm studying Calcite recently and I found that RelNode Tree would be converted to a DAG composed by HepRelVertex and Edge before the RBO rules execution, and I don't understand why this step is necessary since RelNode tree is a DAG essentially.