Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Why DISTINCT is costly?

Re: Why DISTINCT is costly?

From: Umberto <umberto.quaia_at_tin.it>
Date: Tue, 13 Sep 2005 13:03:04 +0200
Message-ID: <4326b203$0$47507$892e7fe2@authen.white.readfreenews.net>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US