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

Xurenhe commented on CALCITE-5109:
----------------------------------

Hi [~Ziwei Liu] Thanks for your comment.
I define some sub-classes of *MaterializedViewRule* to support left join. But 
now it only supports the successive left join, for example:
{code:java}
-- Relationship of t1, t2, t3 is PK and FK
-- view
select * from t1
left join t2 on t1.id = t2.id
left join t3 on t1.id = t3.id
-- query
select * from t1
left join t2 on t1.id = t2.id{code}
But, it is another topic. I think we need open a new jira to discuss it.

Anyhow, *RelMdAllPredicates* supporting to analyze left-join is the foundation 
of mv matching.

 

> RelMdAllPredicates support to analyze left-out-join
> ---------------------------------------------------
>
>                 Key: CALCITE-5109
>                 URL: https://issues.apache.org/jira/browse/CALCITE-5109
>             Project: Calcite
>          Issue Type: Wish
>          Components: core
>            Reporter: Xurenhe
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
>  
> {code:java}
> select * from
>  left_sub_query {left_where_condition}
> join {join_type}
>  right_sub_query {right_where_condition}
> on {on_condition}
> where {where_condition}{code}
>  
> As we know:
>  * join_type is {*}left out join{*}:
>  ** *left_where_condition* could be pulled to *where_condition*
>  ** *right_where_condition* could be pulled to *on_condition*
>  * join_type is *right out join:* 
>  ** *left_where_condition* could be pulled to *on_condition*
>  ** *right_where_condition* could be pulled to *where_condition*
> ----
> There are a large number of star-model in the warehouse. Rewriting query by 
> materialized view is a very effective way to speed up query.
>  
> I'm expanding [*MaterializedViewRule#perform*|#L175]]to support rewriting 
> query when meeting left-out-join, and found that 
> [*RelMdAllPredicates*|#L193]] didn't support to analyze left-join.
> Could calcite support it? This feature is very important for expanding 
> *MaterializedViewRule#perform*
>  



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to