Skip to content

[CALCITE-3968] Disable JoinPushThroughJoinRule.right by default#1958

Closed
hsyuan wants to merge 3 commits intoapache:masterfrom
hsyuan:assiociate
Closed

[CALCITE-3968] Disable JoinPushThroughJoinRule.right by default#1958
hsyuan wants to merge 3 commits intoapache:masterfrom
hsyuan:assiociate

Conversation

@hsyuan
Copy link
Member

@hsyuan hsyuan commented May 2, 2020

JIRA: CALCITE-3968

JoinPushThroughJoinRule.right does
(RS)T -> (RT)S

JoinPushThroughJoinRule.left does
(RS)T -> (TS)R

If JoinCommuteRule is enabled, only enabling JoinPushThroughJoinRule.right can
achieve the same alternative with JoinPushThroughJoinRule.left, vice versa
(suppose they are connected). So there is no need to enable left and right
instances at the same time, which will slow down the optimization dramatically,
e.g TPCH q05, q07 in TpchTest.java never finish. There is also the same bug
report from [1].

Meanwhile, JoinPushThroughJoinRule matches RelNode.class, which is unnecessary.
It should be just a group, or RelSet / RelSubset, as a place holder, because we
don't care about what exactly the top join's right child is. But since the rule
is designed to work with both HepPlanner and VolcanoPlanner, so just bear with
the slowness.

[1] https://lists.apache.org/thread.html/r195c267ef15f50aa21bbcefd7bf523f8bf2495b2345fd163e91e3c36%40%3Cdev.calcite.apache.org%3E

@hsyuan hsyuan changed the title [CALCITE-3968] Disable JoinPushThroughJoinRule.left by default [CALCITE-3968] Disable JoinPushThroughJoinRule.right by default May 2, 2020
@hsyuan hsyuan added the LGTM-will-merge-soon Overall PR looks OK. Only minor things left. label May 4, 2020
hsyuan added 3 commits May 9, 2020 01:49
JoinPushThroughJoinRule.right does
(RS)T -> (RT)S

JoinPushThroughJoinRule.left does
(RS)T -> (TS)R

If JoinCommuteRule is enabled, only enabling JoinPushThroughJoinRule.left can
achieve the same alternative with JoinPushThroughJoinRule.right, vice versa
(suppose they are connected). So there is no need to enable left and right
instances at the same time, which will slow down the optimization dramatically,
e.g TPCH q05, q07 in TpchTest.java never finish. There is also the same bug
report from [1].

Meanwhile, JoinPushThroughJoinRule matches RelNode.class, which is unnecessary.
It should be just a group, or RelSet / RelSubset, as a place holder, because we
don't care about what exactly the top join's right child is. But since the rule
is designed to work with both HepPlanner and VolcanoPlanner, so just bear with
the slowness.

[1] https://lists.apache.org/thread.html/r195c267ef15f50aa21bbcefd7bf523f8bf2495b2345fd163e91e3c36%40%3Cdev.calcite.apache.org%3E
@hsyuan hsyuan removed the LGTM-will-merge-soon Overall PR looks OK. Only minor things left. label May 9, 2020
Copy link
Contributor

@chunweilei chunweilei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@hsyuan
Copy link
Member Author

hsyuan commented May 14, 2020

Closing this PR, since this has been superseded by #1976.

@hsyuan hsyuan closed this May 14, 2020
@hsyuan hsyuan deleted the assiociate branch May 14, 2020 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants