You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Sean Owen (JIRA)" <ji...@apache.org> on 2015/06/19 12:41:00 UTC

[jira] [Updated] (SPARK-8077) Optimisation of TreeNode for large number of children

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

Sean Owen updated SPARK-8077:
-----------------------------
    Assignee: Mick Davies

> Optimisation of TreeNode for large number of children
> -----------------------------------------------------
>
>                 Key: SPARK-8077
>                 URL: https://issues.apache.org/jira/browse/SPARK-8077
>             Project: Spark
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 1.3.1
>            Reporter: Mick Davies
>            Assignee: Mick Davies
>            Priority: Minor
>             Fix For: 1.5.0
>
>
> Large IN clauses are parsed very slowly. For example SQL below (10K items in IN) takes 45-50s. 
> {code}
> s"""SELECT * FROM Person WHERE ForeName IN ('${(1 to 10000).map("n" + _).mkString("','")}')"""
> {code}
> This is principally due to TreeNode which repeatedly call contains on children, where children in this case is a List that is 10K long. In effect parsing for large IN clauses is O(N squared).
> A small change that uses a lazily initialised Set based on children for contains reduces parse time to around 2.5s
> I'd like to create PR for change, as we often use IN clauses with a few thousand items.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org