[
https://issues.apache.org/jira/browse/KYLIN-5865?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17865882#comment-17865882
]
pengfei.zhan commented on KYLIN-5865:
-------------------------------------
h1. RC
Comparison of the original execution plans, with 1=1 on the left and without on
the right.
!8813.3.png|width=1312,height=188!
Optimized execution plan with 1=1 on the left and without on the right.
!8813.4.png|width=1313,height=199!
Why is it that the two sql's are only slightly different, but generate
completely different execution plans? This rewrite was done in the kycalcite of
kylin, which modifies the Calcite source code to add this logic for converting
to an inner join.
Since KapFilterRel and KapJoinRel (left join) were not merged and rewritten as
an inner join, the two subqueries were divided into two olapcontexts, one of
which became a detail and one of which became an aggregate, thus adding the
condition 1=1 and was written to hit an aggregate index and table index.
> Supports OlapFilterJoinRule.FILTER_ON_JOIN
> ------------------------------------------
>
> Key: KYLIN-5865
> URL: https://issues.apache.org/jira/browse/KYLIN-5865
> Project: Kylin
> Issue Type: Bug
> Components: Query Engine
> Affects Versions: 5.0.0
> Reporter: pengfei.zhan
> Assignee: pengfei.zhan
> Priority: Major
> Fix For: 5.0.0
>
> Attachments: 8813.1.png, 8813.2.png, 8813.3.png, 8813.4.png
>
>
> The following SQL hit index problem, casually add a filter condition will
> lead to repair failure, resulting in the query hit aggregation + detail, the
> expectation is to hit the aggregate index.
> !8813.1.png!
> !8813.2.png!
--
This message was sent by Atlassian Jira
(v8.20.10#820010)