impala-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex Behm (Code Review)" <ger...@cloudera.org>
Subject [Impala-ASF-CR] IMPALA-2581: LIMIT can be propagated down into some aggregations
Date Thu, 11 Aug 2016 01:16:54 GMT
Alex Behm has posted comments on this change.

Change subject: IMPALA-2581: LIMIT can be propagated down into some aggregations
......................................................................


Patch Set 4:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/3822/4/fe/src/main/java/com/cloudera/impala/analysis/AggregateInfoBase.java
File fe/src/main/java/com/cloudera/impala/analysis/AggregateInfoBase.java:

Line 182:   public boolean isPreaggLimitable() {
I think this optimization will produce a wrong plan for queries like this one:

select distinct a.int_col, a.bigint_col, b.int_col, b.bigint_col
from functional.alltypes a, functional.alltypes b
where a.id = b.id
having a.int_col + b.int_col < 10

Unfortunately, our planner is not clever enough to move this predicate below the aggregation,
but it shows that this optimization does rely on an additional assumption that is not always
true for us.

I think we can only safely move the limit into the pre-agg if there are no HAVING-clause predicates.
Alternatively, we can also move the HAVING clause predicates into the pre-agg.


-- 
To view, visit http://gerrit.cloudera.org:8080/3822
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I59c5b7af7a73ccdbc5496b28eacb9b6859d202bc
Gerrit-PatchSet: 4
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Jim Apple <jbapple@cloudera.com>
Gerrit-Reviewer: Alex Behm <alex.behm@cloudera.com>
Gerrit-Reviewer: Jim Apple <jbapple@cloudera.com>
Gerrit-Reviewer: Matthew Jacobs <mj@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <tarmstrong@cloudera.com>
Gerrit-HasComments: Yes

Mime
View raw message