This question has been discussed a few times on the mailing list; the most 
recent thread is this one: 
https://lists.apache.org/[email protected]:2024-8:query%20planner%20structure

One thing I found is that some rules are actually buggy, and they do not 
preserve query semantics. So you have to test them very thoroughly.

Mihai


________________________________
From: Liu Yi
Sent: Tuesday, April 1, 2025 11:36 AM
To: [email protected]
Subject: Newbie question: Choosing rules for HepPlanner?

Hey everyone,


I'm new to Apache Calcite and trying to get my head around building a query 
optimizer.


So far, I've managed to parse a set of SQL queries and convert them into 
RelNodes. My understanding is that the next step is often to use a HepPlanner 
followed by a VolcanoPlanner. (Is that generally the right approach?)


My main question is about the HepPlanner. It uses rules, and looking through 
CoreRules, there are so many! They all seem potentially useful in different 
scenarios. How do people typically decide which rules to apply with HepPlanner? 
Do I need to manually figure out the best rules based on the patterns in my 
specific SQLs, or is there a more standard set or strategy?


Any pointers would be awesome!


Thanks,

 Liu Yi

Reply via email to