26 May 2009
"GROUP BY" improves perfomance compare to DISTINCT CLAUSE.
26 May 2009
It depends.
as a rule of thumb: If you don't know exactly about the data, better use GROUP BY.
DISTINCT is better for columns with a low number of rows per value: #rows < #AMPs
GROUP BY is better for columns with a large number of rows per value: #rows > #AMPs
TD13 will automatically rewrite DISTINCT to GROUP BY and apply some new algorithms to get faster response.
Dieter
You must sign in to leave a comment.

Hi,
When we fetch unique rows from a table which is better distinct or group by??