You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@phoenix.apache.org by "Hadoop QA (Jira)" <ji...@apache.org> on 2019/09/24 14:21:00 UTC

[jira] [Commented] (PHOENIX-5491) Improve performance of InListExpression.hashCode

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

Hadoop QA commented on PHOENIX-5491:
------------------------------------

{color:red}-1 overall{color}.  Here are the results of testing the latest attachment 
  http://issues.apache.org/jira/secure/attachment/12981166/PHOENIX-5491.patch
  against master branch at commit 52c658e77f52997d86e2cdb90210cf159dcc1591.
  ATTACHMENT ID: 12981166

    {color:green}+1 @author{color}.  The patch does not contain any @author tags.

    {color:green}+1 tests included{color}.  The patch appears to include 3 new or modified tests.

    {color:green}+1 javac{color}.  The applied patch does not increase the total number of javac compiler warnings.

    {color:green}+1 release audit{color}.  The applied patch does not increase the total number of release audit warnings.

    {color:green}+1 lineLengths{color}.  The patch does not introduce lines longer than 100

    {color:green}+1 core tests{color}.  The patch passed unit tests in .

Test results: https://builds.apache.org/job/PreCommit-PHOENIX-Build/2983//testReport/
Console output: https://builds.apache.org/job/PreCommit-PHOENIX-Build/2983//console

This message is automatically generated.

> Improve performance of InListExpression.hashCode
> ------------------------------------------------
>
>                 Key: PHOENIX-5491
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-5491
>             Project: Phoenix
>          Issue Type: Improvement
>    Affects Versions: 5.0.0, 4.14.3
>            Reporter: Chen Feng
>            Assignee: Chen Feng
>            Priority: Critical
>         Attachments: PHOENIX-5491-v2.patch, PHOENIX-5491.patch
>
>
> In WhereOptimizer.pushKeyExpressionsToScan(), has a line of code: "extractNodes.addAll(nodesToExtract)"
> When executing sqls like "select * from ... where A in (a1, a2, ..., a_n) and B = X", saying A in N (N > 100,000) elements, previous code execution will slow (> 90s in our environment).
> This is because in such case, extractNodes is a HashSet, nodesToExtract is a List with N InListExpression (the N InListExpressions are the same instance), each InListExpression.values has N elements as well.
> HashSet.addAll(list<InListExpression>) will call N times of InListExpression.hashCode(). Each time, InListExpression.hashCode() will calculate hashCode for every value. Therefore, the time complexity will be N^2.
> A simple way to solve it is to remember of the hashCode of InListExpression and returns it directly if calculated once. The query will finish in 5 seconds.



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