Distinct vs Group by clause. Which is faster


#1

I have two queries :
Select Distinct(name) from employee ;
Select name from employee group by name

Both the queries fetch the same result. Which is faster of above two queries ?


#2

DISTINCT is faster when compared to GROUP BY because DISTINCT creates a temporary table and uses it for storing duplicates .Whereas the GROUP BY does the same but sorts the DISTINCT results afterwards.


#3

Distinct is faster than GROUP BY because GROUP BY uses the arranged values or sorted values.