Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Why DISTINCT is costly?
juhunu_at_gmail.com wrote:
> Whenever I use a DISTINCT in my query, I see the "SORT UNIQUE" getting
> added to the execution plan.
>
> "SORT UNIQUE" is increasing the cost of the query by a greater factor.
>
> Any help in reducing the cost in using DISTINCT would be of much help.
>
> Thanks in Advance.
>
If the distinct is used a lot, create an index. The sort-unique should become a fast full index scan.
Umberto Received on Tue Sep 13 2005 - 06:03:04 CDT