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 815B8200B11 for ; Mon, 13 Jun 2016 23:13:07 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 80365160A3C; Mon, 13 Jun 2016 21:13:07 +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 8929A160A1A for ; Mon, 13 Jun 2016 23:13:06 +0200 (CEST) Received: (qmail 87928 invoked by uid 500); 13 Jun 2016 21:13:05 -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 87917 invoked by uid 99); 13 Jun 2016 21:13:05 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Jun 2016 21:13:05 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 54980C1CCA for ; Mon, 13 Jun 2016 21:13:05 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -4.646 X-Spam-Level: X-Spam-Status: No, score=-4.646 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-1.426] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id ntbPMkD9Qtcn for ; Mon, 13 Jun 2016 21:13:04 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with SMTP id 7EC5A5F254 for ; Mon, 13 Jun 2016 21:13:04 +0000 (UTC) Received: (qmail 87692 invoked by uid 99); 13 Jun 2016 21:13:03 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Jun 2016 21:13:03 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id C78AC2C0451 for ; Mon, 13 Jun 2016 21:13:03 +0000 (UTC) Date: Mon, 13 Jun 2016 21:13:03 +0000 (UTC) From: "James Taylor (JIRA)" To: dev@phoenix.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (PHOENIX-2992) Remove ORDER BY from COUNT(DISTINCT...)-only SELECT statements MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 13 Jun 2016 21:13:07 -0000 [ https://issues.apache.org/jira/browse/PHOENIX-2992?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15328277#comment-15328277 ] James Taylor commented on PHOENIX-2992: --------------------------------------- We should remove the ORDER BY for all cases of ungrouped aggregations, so IMHO we should either: - Make the check {{if (groupBy.isUngroupedAggregation() || groupBy == GroupBy.UNGROUPED_GROUP_BY) { }} - Have groupBy.isUngroupedAggregation() be true for GroupBy.UNGROUPED_GROUP_BY Based on the name of the method, isUngroupedAggregation, I'd lean toward the latter as otherwise it's a bit confusing. If we do the former, then we should probably rename the isUngroupedAggregation method to something like isUngroupedCountDistinct. > Remove ORDER BY from COUNT(DISTINCT...)-only SELECT statements > -------------------------------------------------------------- > > Key: PHOENIX-2992 > URL: https://issues.apache.org/jira/browse/PHOENIX-2992 > Project: Phoenix > Issue Type: Sub-task > Reporter: Lars Hofhansl > Assignee: Lars Hofhansl > Fix For: 4.8.0 > > Attachments: 2989-orderby-v3.txt > > > In PHOENIX-2989 we observe that any ORDER BY clause can simply be removed from any statement that only SELECTs on COUNT(DISTINCT ...) -- This message was sent by Atlassian JIRA (v6.3.4#6332)