Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Why DISTINCT is costly?
Thanks for your responses
So there is no way to tweak to the performance with the DISTINCT,
right?
We should either use it with the cost mentioned or restructure the
query in way which doesn't need a distinct.
I would prefer going with the second option.
I have tried few queries by using the group by instead of DISTINCT and i found that the cost is getting doubled by doing so. Hence group by is helpless here.
Noons :-
You have mentioned in you post something like
"If the group by
list is smaller than the select list, you have a need to sort a
lot less bytes."
But we cannont have the columns in select which are not part of group by. I believe that we can only have the columns mentioned in the group by or the group fundtions of the same. So we cannot have more columns in the select than the ones in group by.
Correct me If I am wrong Received on Tue Sep 13 2005 - 04:06:28 CDT