I would like to know if there is any difference concerning performance when choosing DISTINCT or GROUP BY to bring distinct rows from a query.
I've tried comparing the execution plans, but they seem to be the same for both queries.
Or does it have to do with the complexity of the query? If so, an example would be appreciable.
Example - when I run the following queries against the database it shows exactly the same execution plan for each one:
select distinct table_name
from information_schema.columns
where table_name = 'Customer';
select table_name
from information_schema.columns
where table_name = 'Customer'
group by table_name;
PS.: These simple queries are just to illustrate the question with an actual example.
SUM(...)
that are not supported byDISTINCT
.