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

Julian Hyde commented on CALCITE-4160:
--------------------------------------

Interesting research, [~zabetak]. But the issue remains: if we allow ORDER BY 
in sub-queries, when is it safe/valid to remove the Sort without affecting 
semantics. As I have noted, if people use a view that contains ORDER BY in a 
query, the algebra for that query will now contain a Sort but the Sort is 
probably not necessary for correctness, and implementing it will make the plan 
less efficient.

> Add configuration to retain ORDER BY in sub-query
> -------------------------------------------------
>
>                 Key: CALCITE-4160
>                 URL: https://issues.apache.org/jira/browse/CALCITE-4160
>             Project: Calcite
>          Issue Type: Improvement
>          Components: core
>            Reporter: Jiatao Tao
>            Assignee: Jiatao Tao
>            Priority: Minor
>              Labels: pull-request-available
>         Attachments: image-2020-08-07-10-48-59-599.png, 
> image-2020-08-07-10-50-22-351.png
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> Pre discussion see in 
> https://issues.apache.org/jira/browse/CALCITE-2798
> https://issues.apache.org/jira/browse/CALCITE-3664
> IMO, we should at least provide a configuration about this. People use 
> Calcite most for its optimizer, and this info users may care, How it executed 
> is by the engine, but users should know this in the plan.
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to