You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Julian Hyde (JIRA)" <ji...@apache.org> on 2015/07/24 23:55:05 UTC

[jira] [Commented] (CALCITE-793) The compiler asks for unnecessary collation trait on plan with materialized view

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

Julian Hyde commented on CALCITE-793:
-------------------------------------

I've seen changes from SUM to and from $SUM0 before. I agree, it seems to be due to an unstable cost model. If your change fixes that instability that would be great (it might cause a few test failures) -- go ahead and submit.

> The compiler asks for unnecessary collation trait on plan with materialized view
> --------------------------------------------------------------------------------
>
>                 Key: CALCITE-793
>                 URL: https://issues.apache.org/jira/browse/CALCITE-793
>             Project: Calcite
>          Issue Type: Bug
>    Affects Versions: 1.4.0-incubating
>            Reporter: Maryann Xue
>            Assignee: Julian Hyde
>             Fix For: next
>
>         Attachments: CALCITE-793.patch
>
>   Original Estimate: 120h
>  Remaining Estimate: 120h
>
> When a query does not have an ORDER BY clause, we should ignore the collation trait of the main table plan and should not request the materialized view plan to have the same collation.
> For example, we have a table 'A' sorted by primary key 'id', and we have a materialized view 'V' projected from 'A' which is sorted by column 'col1'. And now we have a query like "select id, col0, col1, col2 from A where col1 < '10'".
> The main table plan will come out like a Filter on top of a TableScan of 'A', while the materialized view plan should also be something like a Filter on top of a TableScan of 'V' and it should not have a Sort, so that if doing a col1 related filter on col1 ordered table 'V' is cheaper, the materialized view plan will be chosen.



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