You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2020/08/14 09:43:20 UTC

[GitHub] [incubator-doris] wyndia opened a new issue #4353: [Question] a more complex query runs count(distinct) faster.

wyndia opened a new issue #4353:
URL: https://github.com/apache/incubator-doris/issues/4353


   HI. I'm using Doris 0.12.0 on one single machine (1 FE, 1 BE). And I have table t looking like this:
   ```SQL
   CREATE TABLE `t` (
     `user_id` char(16) NULL COMMENT ""
   ) ENGINE=OLAP
   DUPLICATE KEY(`user_id`)
   COMMENT "OLAP"
   DISTRIBUTED BY HASH(`user_id`) BUCKETS 64
   PROPERTIES (
   "storage_type" = "COLUMN",
    "colocate_with" = "group1",
    "replication_num" = "1",
    "in_memory" = "false"
   );
   ```
   It has about 90,000,000 records and they are all unique.
   However, I find these two queries perform differently:
   ```SQL
   select count(distinct a.user_id) from t a join t b on a.user_id = b.user_id;  -- finished in 22 sec
   select count(distinct user_id) from t;  -- finished in 58s
   ```
   The first one runs almost twice as fast as the second one.
   I'm very confused right now. Does it have something to do with the colocation group? 
   Can any one explain this for me please?
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] wyndia commented on issue #4353: [Question] a more complex query runs count(distinct) faster.

Posted by GitBox <gi...@apache.org>.
wyndia commented on issue #4353:
URL: https://github.com/apache/incubator-doris/issues/4353#issuecomment-674360667


   > You can try to get a profile first,
   > http://doris.incubator.apache.org/master/zh-CN/administrator-guide/running-profile.html
   
   Thank you! The profile is very helpful. 
   I just find that modifying `parallel_fragment_exec_instance_num` will make improvements. (but will cost more resources)


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] wyndia closed issue #4353: [Question] a more complex query runs count(distinct) faster.

Posted by GitBox <gi...@apache.org>.
wyndia closed issue #4353:
URL: https://github.com/apache/incubator-doris/issues/4353


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] morningman commented on issue #4353: [Question] a more complex query runs count(distinct) faster.

Posted by GitBox <gi...@apache.org>.
morningman commented on issue #4353:
URL: https://github.com/apache/incubator-doris/issues/4353#issuecomment-674341911


   You can try to get a profile first,
   http://doris.incubator.apache.org/master/zh-CN/administrator-guide/running-profile.html


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org