You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Jinfeng Ni (JIRA)" <ji...@apache.org> on 2015/05/16 07:35:59 UTC

[jira] [Commented] (DRILL-3117) Wrong Join-Order when In-List is materialized as a table

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

Jinfeng Ni commented on DRILL-3117:
-----------------------------------

Why do you think the root cause of DRILL-2929 is same as this one? The query in DRILL-2929 does not have an IN predicate, and it hangs in the planing stage. 

> Wrong Join-Order when In-List is materialized as a table
> --------------------------------------------------------
>
>                 Key: DRILL-3117
>                 URL: https://issues.apache.org/jira/browse/DRILL-3117
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Query Planning & Optimization
>            Reporter: Sean Hsuan-Yi Chu
>            Assignee: Sean Hsuan-Yi Chu
>
> After the number of elements in In-List exceeds a threshold (set as 20 by DRILL-3009), Drill materializes In-List into a table as an alternative to performing lots of comparisons for each row. For instance, assuming `c.json` has lots of rows (> 100,000) and we have this query:
> select a.col from `c.json` a, `c.json` b
> where a.col = b.col and a.id in (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21);
> Currently, Calcite generates a plan which performs JOIN on tables a & b firstly. However, this is an extremely expensive operation. Instead, Drill should have JOINed the materialized table with table a. 
> This issue is also the root reason for the slow query reported in DRILL-2929.



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