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

Fabian Hueske commented on FLINK-3944:
--------------------------------------

I tried the fix on another query and found that the search space grew too large 
due to the added rewrite rules. On a moderately complex query and the 
optimization did not terminate. Since we do not have reliable estimates, the 
optimizer cannot effectively prune search space and the enumeration of 
alternatives takes too much time. 

I propose to revert this commit. Users will have to specify tables in an order 
that does not include Cartesian products.

> Add optimization rules to reorder Cartesian products and joins
> --------------------------------------------------------------
>
>                 Key: FLINK-3944
>                 URL: https://issues.apache.org/jira/browse/FLINK-3944
>             Project: Flink
>          Issue Type: Bug
>          Components: Table API
>    Affects Versions: 1.1.0
>            Reporter: Fabian Hueske
>            Assignee: Fabian Hueske
>            Priority: Critical
>             Fix For: 1.1.0
>
>
> Currently, we do not support the execution of Cartesian products. 
> Because we do not optimize the order of joins (due to missing statistics), 
> joins are executed in the order in which they are specified. This works well 
> for the Table API, however it can be problematic in case of SQL queries where 
> the order of tables in the FROM clause should not matter.
> In case of SQL queries, it can happen that the optimized plan contains 
> Cartesian products because joins are not reordered. If we add optimization 
> rules that switch Cartesian products and joins, such situations can be 
> resolved.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to