Return-Path: X-Original-To: apmail-impala-dev-archive@minotaur.apache.org Delivered-To: apmail-impala-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E983D19C3B for ; Fri, 1 Apr 2016 16:36:08 +0000 (UTC) Received: (qmail 64755 invoked by uid 500); 1 Apr 2016 16:36:08 -0000 Delivered-To: apmail-impala-dev-archive@impala.apache.org Received: (qmail 64716 invoked by uid 500); 1 Apr 2016 16:36:08 -0000 Mailing-List: contact dev-help@impala.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@impala.incubator.apache.org Delivered-To: mailing list dev@impala.incubator.apache.org Received: (qmail 64705 invoked by uid 99); 1 Apr 2016 16:36:08 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Apr 2016 16:36:08 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 12B44C0225 for ; Fri, 1 Apr 2016 16:36:08 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.362 X-Spam-Level: X-Spam-Status: No, score=0.362 tagged_above=-999 required=6.31 tests=[RDNS_DYNAMIC=0.363, SPF_PASS=-0.001] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id vcKLuL4ZpUk2 for ; Fri, 1 Apr 2016 16:36:05 +0000 (UTC) Received: from ip-10-146-233-104.ec2.internal (ec2-75-101-130-251.compute-1.amazonaws.com [75.101.130.251]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id F11A95F247 for ; Fri, 1 Apr 2016 16:36:04 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by ip-10-146-233-104.ec2.internal (8.14.4/8.14.4) with ESMTP id u31Ga2bM021893; Fri, 1 Apr 2016 16:36:02 GMT Message-Id: <201604011636.u31Ga2bM021893@ip-10-146-233-104.ec2.internal> Date: Fri, 1 Apr 2016 16:36:02 +0000 From: "Marcel Kornacker (Code Review)" To: Thomas Tauber-Marshall , impala-cr@cloudera.com, dev@impala.incubator.apache.org CC: Matthew Jacobs , Alex Behm , Mostafa Mokhtar Reply-To: marcel@cloudera.com X-Gerrit-MessageType: comment Subject: =?UTF-8?Q?[Impala-CR](cdh5-trunk)_IMPALA-2805:_Order_filters_based_on_selectivity_and_cost=0A?= X-Gerrit-Change-Id: I02279a26fbc6308ac5eb819d78345fc010469034 X-Gerrit-ChangeURL: X-Gerrit-Commit: e5c18a877390b56230081c0a3166037996f24905 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Content-Disposition: inline User-Agent: Gerrit/2.10-rc0 Marcel Kornacker has posted comments on this change. Change subject: IMPALA-2805: Order filters based on selectivity and cost ...................................................................... Patch Set 3: (6 comments) almost there. nice! http://gerrit.cloudera.org:8080/#/c/2598/3/fe/src/main/java/com/cloudera/impala/analysis/AnalyticExpr.java File fe/src/main/java/com/cloudera/impala/analysis/AnalyticExpr.java: Line 543: // This is not currently used as an AnalyticExpr cannot be a child of a conjunct. i would group that with the type assignment, because it's a standard component that has to be computed for every expr. easier to find that way. http://gerrit.cloudera.org:8080/#/c/2598/3/fe/src/main/java/com/cloudera/impala/analysis/CaseExpr.java File fe/src/main/java/com/cloudera/impala/analysis/CaseExpr.java: Line 330: evalCost_ = CASE_COST; do we need that (on top of the costs of the branches)? http://gerrit.cloudera.org:8080/#/c/2598/3/fe/src/main/java/com/cloudera/impala/analysis/Expr.java File fe/src/main/java/com/cloudera/impala/analysis/Expr.java: Line 191: // its children. evalCost_ will be -1 if it has not been calculated yet. evalCost_ you should point out when this gets set (see comment for selectivity_). also, rather than saying '-1 means invalid', you should say 'valid only after analysis'. we use -1 elsewhere to mean unknown elsewhere, which isn't quite the same (because in getCost() you assert it's != -1). Line 235: Preconditions.checkState(evalCost_ >= 0); check for isAnalyzed_ instead Line 1249: public static List orderConjuncts(List conjuncts) { too generic a name; orderConjunctsByCost? http://gerrit.cloudera.org:8080/#/c/2598/3/fe/src/main/java/com/cloudera/impala/analysis/InPredicate.java File fe/src/main/java/com/cloudera/impala/analysis/InPredicate.java: Line 185: IN_COST; is in_cost needed? (isn't that captured by the binary_predicate_cost?) -- To view, visit http://gerrit.cloudera.org:8080/2598 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-MessageType: comment Gerrit-Change-Id: I02279a26fbc6308ac5eb819d78345fc010469034 Gerrit-PatchSet: 3 Gerrit-Project: Impala Gerrit-Branch: cdh5-trunk Gerrit-Owner: Thomas Tauber-Marshall Gerrit-Reviewer: Alex Behm Gerrit-Reviewer: Marcel Kornacker Gerrit-Reviewer: Matthew Jacobs Gerrit-Reviewer: Mostafa Mokhtar Gerrit-Reviewer: Thomas Tauber-Marshall Gerrit-HasComments: Yes