You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2021/11/11 09:23:47 UTC

[GitHub] [incubator-doris] EmmyMiao87 opened a new issue #7096: [Feature] Transitive Closure

EmmyMiao87 opened a new issue #7096:
URL: https://github.com/apache/incubator-doris/issues/7096


   ### Search before asking
   
   - [X] I had searched in the [issues](https://github.com/apache/incubator-doris/issues?q=is%3Aissue) and found no similar issues.
   
   
   ### Description
   
   Transitive Closure 应用在 Doris 中主要指的是添加冗余 SQL 连接条件,通过冗余条件减少查询的数据量从而提升查询性能的一种 SQL 优化。 
   形式上,这称为传递闭包,即如果 a=b 和 a=1,则它遵循 b=1。
   
   Doris 当前支持两个表之间的谓词传递,比如 a=b and a=1 。但他不支持多个表之间的传递。比如 a= b and b=c and a=1 这时,a=1 只能传递为 b=1 但是不能传递出 c=1。
   
   ### Use case
   
   举个例子
   ```
   select * from t1, t2, t3 where t1.id=t2.id and t2.id=t3.id and t3.id=1;
   ```
   上面这个查询他应该能传递出下面两个谓词
   ```
   t2.id = 1
   t1.id = 1
   ```
   则查询效果应该等同于
   ```
   select * from t1, t2, t3 where t1.id=t2.id and t2.id=t3.id and t3.id=1 and t2.id=1 and t1.id=1;
   ```
   
   这么做的好处在于当 filter predicate 传递给了其他表,他就可以提前过滤掉大量数据,从而提升查询性能。
   
   
   ### Related issues
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] zhengshiJ edited a comment on issue #7096: [Feature] Transitive Closure

Posted by GitBox <gi...@apache.org>.
zhengshiJ edited a comment on issue #7096:
URL: https://github.com/apache/incubator-doris/issues/7096#issuecomment-976378548


   - 注册一个新的规则InferFiltersrule,添加到GlobalState中。
   - 遍历Conjunct构造on/where的等值连接、数值连接以及isNullPredicate。
   - 利用Warshall推理出全部的等值连接
   - 构造出额外的数值连接和isNullPredicate
   
    
   
   - Register a new rule InferFiltersrule and add it to GlobalState.
   - Traverse Conjunct to construct on/where equivalence connection, numerical connection and isNullPredicate.
   - Use Warshall to infer all equivalence connections
   - Construct additional numerical connections and isNullPredicate


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] EmmyMiao87 commented on issue #7096: [Feature] Transitive Closure

Posted by GitBox <gi...@apache.org>.
EmmyMiao87 commented on issue #7096:
URL: https://github.com/apache/incubator-doris/issues/7096#issuecomment-966964302


   Warshall算法计算 Transitive Closure


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] zhengshiJ removed a comment on issue #7096: [Feature] Transitive Closure

Posted by GitBox <gi...@apache.org>.
zhengshiJ removed a comment on issue #7096:
URL: https://github.com/apache/incubator-doris/issues/7096#issuecomment-976378106


   1. 注册一个新的规则InferFiltersrule,添加到GlobalState中。
   2. 遍历Conjunct构造on/where的等值连接、数值连接以及isNullPredicate。
   3. 利用Warshall算法推断出全部的等值连接
   4. 构造出额外的数值连接和isNullPredicate
   
   1. Register a new rule InferFiltersrule and add it to GlobalState.
   2. Traverse Conjunct to construct on/where equivalence connection, numerical connection and isNullPredicate.
   3. Use Warshall to infer all equivalence connections
   4. Construct additional numerical connections and isNullPredicate


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] zhengshiJ commented on issue #7096: [Feature] Transitive Closure

Posted by GitBox <gi...@apache.org>.
zhengshiJ commented on issue #7096:
URL: https://github.com/apache/incubator-doris/issues/7096#issuecomment-976378548


   1. 注册一个新的规则InferFiltersrule,添加到GlobalState中。
   2. 遍历Conjunct构造on/where的等值连接、数值连接以及isNullPredicate。
   3.利用Warshall推理出全部的等值连接
   4.构造出额外的数值连接和isNullPredicate
   
   
   1. Register a new rule InferFiltersrule and add it to GlobalState.
   2. Traverse Conjunct to construct on/where equivalence connection, numerical connection and isNullPredicate.
   3. Use Warshall to infer all equivalence connections
   4. Construct additional numerical connections and isNullPredicate


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] zhengshiJ commented on issue #7096: [Feature] Transitive Closure

Posted by GitBox <gi...@apache.org>.
zhengshiJ commented on issue #7096:
URL: https://github.com/apache/incubator-doris/issues/7096#issuecomment-966774822


   working on this


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] zhengshiJ commented on issue #7096: [Feature] Transitive Closure

Posted by GitBox <gi...@apache.org>.
zhengshiJ commented on issue #7096:
URL: https://github.com/apache/incubator-doris/issues/7096#issuecomment-976378106


   1. 注册一个新的规则InferFiltersrule,添加到GlobalState中。
   2. 遍历Conjunct构造on/where的等值连接、数值连接以及isNullPredicate。
   3. 利用Warshall算法推断出全部的等值连接
   4. 构造出额外的数值连接和isNullPredicate
   
   1. Register a new rule InferFiltersrule and add it to GlobalState.
   2. Traverse Conjunct to construct on/where equivalence connection, numerical connection and isNullPredicate.
   3. Use Warshall to infer all equivalence connections
   4. Construct additional numerical connections and isNullPredicate


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] EmmyMiao87 closed issue #7096: [Feature] Transitive Closure

Posted by GitBox <gi...@apache.org>.
EmmyMiao87 closed issue #7096:
URL: https://github.com/apache/incubator-doris/issues/7096


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org