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

ASF subversion and git services commented on IMPALA-9358:
---------------------------------------------------------

Commit d971b19dee289d8fe54eebf484cb14ee6d56f60e in impala's branch 
refs/heads/master from Kurt Deschler
[ https://gitbox.apache.org/repos/asf?p=impala.git;h=d971b19 ]

IMPALA-9358: Query slowdown with inline views and hundreds of columns

IMPALA-8386 introduced an expensive precondition check using the function
ExprSubstitutionMap.checkComposedFrom(). This check has significant
performance impact on statements that contain inline views with hundreds
of columns. Most of the cost is in the get() calls used to find
expressions in the local substitution map.

The fix is to add a getWithHint() call that uses the current loop index as a
starting point to search for expressions. This leverages the fact that
expressions have identical positions in both substitution maps in most
common cases.

A more generic approach would be to accelerate expression equality search
using hash functions but that would be a much riskier fix and Impala
currently lacks the infrasturucture to so.

Testing:
Performance testing with a query with 1000 expressions of the
following form:
  with a as (select c1 c1, c1 c2, c1 c3, ... from t)
  select c1, c2, c3, ... from a;

repro query went from 12 sec to 1 sec.
There was no noticeable time spent in the precondition now.

Change-Id: I77423d9c10e1edbb505cb210b5c072281b5d7cfc
Reviewed-on: http://gerrit.cloudera.org:8080/15157
Reviewed-by: Impala Public Jenkins <[email protected]>
Tested-by: Impala Public Jenkins <[email protected]>


> Query slowdown with inline views and hundreds of columns
> --------------------------------------------------------
>
>                 Key: IMPALA-9358
>                 URL: https://issues.apache.org/jira/browse/IMPALA-9358
>             Project: IMPALA
>          Issue Type: Bug
>          Components: Frontend
>    Affects Versions: Impala 3.2.0
>            Reporter: Kurt Deschler
>            Assignee: Kurt Deschler
>            Priority: Major
>             Fix For: Impala 3.4.0
>
>
> IMPALA-8386 introduced an expensive precondition check using the function 
> ExprSubstitutionMap.checkComposedFrom(). This check has significant 
> performance impact on statements that contain inline views with hundreds of 
> columns. This check needs to be made more efficient to avoid exponential 
> slowdowns with many columns.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to