Yes, you can call call.transformTo 0, 1 or more times from within RelOptRule.onMatch.
All of the successors are deemed to be equivalent to the top RelNode matched by the rule, and VolcanoPlanner will use cost to pick the best. I’m not quite sure what happens if you call such a rule from within HepPlanner. > On Jul 6, 2017, at 3:23 PM, Michael Alexeev <[email protected]> wrote: > > Hi All, > > Is it possible to generate multiple transformations from a single rule > match by calling RelOptRuleCall.transformTo multiple times with > different RelNode from withing the onMatch call? > > My use case is that I have a table with multiple indexes defined and > depending on a filter expression I need to pick the best index available > based on an index scan cost. I have a custom FilterScanMergeRule that > should transform an original Filter/LogicalScan pair into multiple > IndexScan RelNodes but I am not sure whether this is the right way to go. > > Thanks, > Mike
