You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Goun Na (JIRA)" <ji...@apache.org> on 2018/04/24 05:17:00 UTC

[jira] [Commented] (HIVE-10568) Select count(distinct()) can have more optimal execution plan

    [ https://issues.apache.org/jira/browse/HIVE-10568?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16449299#comment-16449299 ] 

Goun Na commented on HIVE-10568:
--------------------------------

I appreciate this patch. In our internal cluster, 1 hour query became 5 minutes without manual modification. Thanks!

> 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
>            Priority: Major
>             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
(v7.6.3#76005)