Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Deadly sins againts database performance/scalability
Cris Carampa wrote:
> Alkos wrote:
>
>> Most of the time, people use SELECT DISTINCT to get unique rows because >> they don't want to "bother" with the datamodel. They are lazy or >> hurried so >> they don't care about possible >> keys, about WHERE clauses selectivity and all that kind of things so >> quick >> and dirty solution to be sure to get unique rows : SELECT DISTINCT which >> implies a sort therefore more activity to get the same result as they may >> have gotten quicker with a little bit work on the WHERE clause.
select distinct e.first_name
from employees e, departments d;
versus
select e.first_name
from employees e, departments d
where e.department_id=d.department_id;
Oversimplified, of course, but it's the idea.
-- Regards, Frank van BortelReceived on Fri Nov 28 2003 - 05:46:15 CST