Is Group by Better Than Distinct
While Distinct Better Explains Intent, and Group by Is Only Required When Aggregations Are Present, They Are Interchangeable in Many Cases. Which One Is Faster...
While DISTINCT better explains intent, and GROUP BY is only required when aggregations are present, they are interchangeable in many cases.
Which one is faster distinct or GROUP BY?
DISTINCT is much faster with large amount data. I tested this, and found that on an indexed column, mysql, group by was about 6x slower than distinct with a fairly complicated query.
Which is faster distinct or GROUP BY in hive?
In hive, however, the former only has one reduce task while the latter has many. From experiments, I founded that the GROUP BY is 10+ times faster than DISTINCT.