Return-Path: X-Original-To: apmail-hive-issues-archive@minotaur.apache.org Delivered-To: apmail-hive-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 480D917F45 for ; Fri, 28 Aug 2015 00:43:46 +0000 (UTC) Received: (qmail 42851 invoked by uid 500); 28 Aug 2015 00:43:45 -0000 Delivered-To: apmail-hive-issues-archive@hive.apache.org Received: (qmail 42669 invoked by uid 500); 28 Aug 2015 00:43:45 -0000 Mailing-List: contact issues-help@hive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hive.apache.org Delivered-To: mailing list issues@hive.apache.org Received: (qmail 42567 invoked by uid 99); 28 Aug 2015 00:43:45 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 28 Aug 2015 00:43:45 +0000 Date: Fri, 28 Aug 2015 00:43:45 +0000 (UTC) From: "Shannon Ladymon (JIRA)" To: issues@hive.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (HIVE-10568) Select count(distinct()) can have more optimal execution plan MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HIVE-10568?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Shannon Ladymon updated HIVE-10568: ----------------------------------- Labels: (was: TODOC1.2) > Select count(distinct()) can have more optimal execution plan > ------------------------------------------------------------- > > Key: HIVE-10568 > URL: https://issues.apache.org/jira/browse/HIVE-10568 > Project: Hive > Issue Type: Improvement > Components: CBO, Logical Optimizer > Affects Versions: 0.6.0, 0.7.0, 0.8.0, 0.9.0, 0.10.0, 0.11.0, 0.12.0, 0.13.0, 0.14.0, 1.0.0, 1.1.0 > Reporter: Mostafa Mokhtar > Assignee: Ashutosh Chauhan > Fix For: 1.2.0 > > Attachments: HIVE-10568.1.patch, HIVE-10568.2.patch, HIVE-10568.patch, HIVE-10568.patch > > > {code:sql} > select count(distinct ss_ticket_number) from store_sales; > {code} > can be rewritten as > {code:sql} > select count(1) from (select distinct ss_ticket_number from store_sales) a; > {code} > which may run upto 3x faster -- This message was sent by Atlassian JIRA (v6.3.4#6332)