hive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ashutosh Chauhan (JIRA)" <j...@apache.org>
Subject [jira] [Created] (HIVE-10568) Select count(distinct()) can have more optimal execution plan
Date Fri, 01 May 2015 01:30:06 GMT
Ashutosh Chauhan created HIVE-10568:
---------------------------------------

             Summary: 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: 1.0.0, 0.14.0, 0.13.0, 0.12.0, 0.11.0, 0.10.0, 0.9.0, 0.8.0, 0.7.0,
0.6.0, 1.1.0
            Reporter: Mostafa Mokhtar
            Assignee: Ashutosh Chauhan


{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)

Mime
View raw message