Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 953CE200D48 for ; Wed, 15 Nov 2017 02:55:13 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 93A27160BF4; Wed, 15 Nov 2017 01:55:13 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id CFCA3160C08 for ; Wed, 15 Nov 2017 02:55:12 +0100 (CET) Received: (qmail 63012 invoked by uid 500); 15 Nov 2017 01:55:11 -0000 Mailing-List: contact dev-help@phoenix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@phoenix.apache.org Delivered-To: mailing list dev@phoenix.apache.org Received: (qmail 62948 invoked by uid 99); 15 Nov 2017 01:55:11 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 Nov 2017 01:55:11 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id B0324E0810; Wed, 15 Nov 2017 01:55:10 +0000 (UTC) From: JamesRTaylor To: dev@phoenix.apache.org Reply-To: dev@phoenix.apache.org References: In-Reply-To: Subject: [GitHub] phoenix pull request #281: PHOENIX-4288 Indexes not used when ordering by pr... Content-Type: text/plain Message-Id: <20171115015510.B0324E0810@git1-us-west.apache.org> Date: Wed, 15 Nov 2017 01:55:10 +0000 (UTC) archived-at: Wed, 15 Nov 2017 01:55:13 -0000 Github user JamesRTaylor commented on a diff in the pull request: https://github.com/apache/phoenix/pull/281#discussion_r151014126 --- Diff: phoenix-core/src/main/java/org/apache/phoenix/execute/HashJoinPlan.java --- @@ -290,6 +291,25 @@ public FilterableStatement getStatement() { return statement; } + @Override + public Cost getCost() throws SQLException { + Long byteCount = getEstimatedBytesToScan(); + if (byteCount == null) { + return Cost.ZERO; + } + + Cost cost = new Cost(0, 0, byteCount); + Cost lhsCost = delegate.getCost(); + if (keyRangeExpressions != null) { + lhsCost = lhsCost.multiplyBy(0.01); --- End diff -- Why the 0.01? More comments would be good. ---