You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Jiatao Tao (Jira)" <ji...@apache.org> on 2020/12/08 02:31:00 UTC

[jira] [Comment Edited] (CALCITE-4428) Remove the equiv rel from mapRel2Subset when merging set

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

Jiatao Tao edited comment on CALCITE-4428 at 12/8/20, 2:30 AM:
---------------------------------------------------------------

Previous in [#2222|https://github.com/apache/calcite/pull/2222], we will skip the origin rule match when rel has been removed from its subset, but this implement calls subset.getRelList() and it has a performance issue. The correct way to do this is to remove the subset from mapRel2Subset.

We can use TpchTest#testQuery07 can directly reproduce the situation that [#2222|https://github.com/apache/calcite/pull/2222] wanted to fix. Put this in VolcanoRuleCall#match, delete the previous code, and run the test, we can see the prints are full of the console(about 8k+). So I think still it is necessary to do it, it can avoid lots of unless rule match.

 
{code:java}
        if (subset != rel && !subset.getRelList().contains(rel)) {
          System.out.println("Rule [{}] not fired because operand #{} ({}) belongs to obsolete set");;
        }
{code}
 


was (Author: aron.tao):
Previous in [#2222|https://github.com/apache/calcite/pull/2222], we will skip the origin rule match when rel has been removed from its subset, but this implement calls subset.getRelList() and it has a performance issue. The correct way to do this is to remove the subset from mapRel2Subset.

We can use TpchTest#testQuery07 can directly reproduce the situation that [#2222|https://github.com/apache/calcite/pull/2222] wanted to fix. Put this in VolcanoRuleCall#match, delete the previous code, and run the test, we can see the prints are full of the console(about 8k+). So I think still it is necessary to do it, it can avoid lots of unless rule match.

 
{code:java}
        if (subset != rel && !subset.getRelList().contains(rel)) {
          System.out.println("Rule [{}] not fired because operand #{} ({}) belongs to obsolete set");;
        }
{code}
{{}}

> Remove the equiv rel from mapRel2Subset when merging set
> --------------------------------------------------------
>
>                 Key: CALCITE-4428
>                 URL: https://issues.apache.org/jira/browse/CALCITE-4428
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>            Reporter: Jiatao Tao
>            Assignee: Jiatao Tao
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 1h 10m
>  Remaining Estimate: 0h
>




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