I believe you're correct that it's not possible to select which planner to use via JDBC. However, keep in mind that the HepPlanner and VolcanoPlanner have different goals. VolcanoPlanner takes longer because it is trying to minimize the expected cost of execution. HepPlanner simply applies the given rules in order. (Which rules to select for HepPlanner is another question as this itself is a challenging problem.) The resulting query is not necessarily any faster. Which planner is better will depend on the specific queries being executed.
-- Michael Mior [email protected] Le dim. 2 août 2020 à 15:38, Rui Wang <[email protected]> a écrit : > > I tried to dig into the Calcite codebase and found there is likely no way > to enable JDBC codepath: > 1. There is no planner config in CalciteConnectionProperty [1]. > 2. In CalcitePrepareImpl, there is only one createPlannerFactory with one > createPlanner, in which VolcanoPlanner is used [2]. > > > If my understanding is correct, then there could be an improvement that > adds a config to CalciteConnectionProperty, and use that config to control > which planner to use by JDBC approach. > > > [1]: > https://github.com/apache/calcite/blob/master/core/src/main/java/org/apache/calcite/config/CalciteConnectionProperty.java#L37 > [2]: > https://github.com/apache/calcite/blob/2088488ac8327b19512a76a122cae2961fc551c3/core/src/main/java/org/apache/calcite/prepare/CalcitePrepareImpl.java#L427 > > > -Rui > > On Sun, Aug 2, 2020 at 8:55 AM Meron Avigdor <[email protected]> > wrote: > > > Hi. > > I have implemented an extension of org.apache.calcite.jdbc.Driver, and I > > have the model handler extend org.apache.calcite.avatica.HandlerImpl > > > > For performance optimizations, I would like to test VolcanoPlanner vs. > > HepPlanner > > as the documentation says that the latter is faster. > > > > How is this to be configured? I could not find a hook point to return the > > planner to be used. > > > > Thank you. > > Meron > >
