[ 
https://issues.apache.org/jira/browse/CALCITE-3753?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17022372#comment-17022372
 ] 

Julian Hyde commented on CALCITE-3753:
--------------------------------------

Earlier you said that the sorted queue was the problem. If that is indeed the 
main problem, moving to a FIFO (non-sorted) queue would solve it.

(Also worth considering, independent of what we decide on substitution rules, 
to change the match queue to a FIFO queue, which is the same as declaring that 
every match has the same importance.)

How would you declare that a rule is a "substitution rule"?
* Is it true that a particular rule class, say {{ProjectMergeRule}}, is always 
either a substitution rule or not a substitution rule? (If so, we could have 
{{interface SubsitutionRule extends RelOptRule}} or similar.)
* Or is it a property of the rule instance (i.e. different instances of the 
same class with {{boolean substitution}} set to different) values?
* Or is it decided when a rule calls {{RelOptRuleCall.transformTo}}?
* Or is it a property of the planner - a bunch of rules are supplied as 
'substitution rules' and are applied when {{RelOptPlanner.register}} is called?

> Always try to match and execute substitution rule first and remove rulematch 
> ordering
> -------------------------------------------------------------------------------------
>
>                 Key: CALCITE-3753
>                 URL: https://issues.apache.org/jira/browse/CALCITE-3753
>             Project: Calcite
>          Issue Type: Improvement
>          Components: core
>            Reporter: Haisheng Yuan
>            Priority: Major
>
> In VolcanoPlanner, some rules e.g. ProjectMergeRule, PruneEmptyRule can be 
> defined as SubstitutionRule, so that we can always try to match and execute 
> them first (without deferring rule call). All the other rulematches doesn't 
> need to be sorted and rules can be executed in any order they matched, since 
> we are going to execute all of them anyway, sooner or later. Computing and 
> comparing importances cause a lot of latency.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to