You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Vladimir Sitnikov (JIRA)" <ji...@apache.org> on 2019/01/09 19:57:00 UTC

[jira] [Resolved] (CALCITE-2635) getMonotonocity is slow on wide tables

     [ https://issues.apache.org/jira/browse/CALCITE-2635?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Vladimir Sitnikov resolved CALCITE-2635.
----------------------------------------
       Resolution: Fixed
    Fix Version/s: 1.19.0

Fixed in https://gitbox.apache.org/repos/asf?p=calcite.git;a=commit;h=62b47aeeb7eeb59beaf5b8f3b54a5c58ba4ca76d

> getMonotonocity is slow on wide tables
> --------------------------------------
>
>                 Key: CALCITE-2635
>                 URL: https://issues.apache.org/jira/browse/CALCITE-2635
>             Project: Calcite
>          Issue Type: Improvement
>          Components: core
>            Reporter: Gian Merlino
>            Assignee: Gian Merlino
>            Priority: Major
>              Labels: performance
>             Fix For: 1.19.0
>
>
> RelOptTableImpl's getMonotonocity does an indexOf on {{rowType.getFieldNames()}}, which is O(N) in the number of fields. IdentifierNamespace calls getMonotonicity once for every field in the table namespace, so it becomes O(N^2) in the number of fields. We observed 2-4 second query planning times with a table that had 18,000 columns, reduced to about 150ms after patching getMonotonicity to be O(1) in the number of fields.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)