Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> count(distinct) and SORT_AREA_SIZE
In the select statement
select count(distinct col1), count(distinct col2), count(distinct
col3),... count(distinct col25)
from table;
How many sorts are performed? If I set the event 10032, it shows only 1 sort. It shows the total number of input records as sum of all the non-null column values. If so, does it do a single sort by prefixing with column id or column position and sort. Won't it increase the complexity of the sort? Or for a select with 25 columns, does it do 25 sorts simultaneously? If that is the case SORT_AREA_SIZE being a fixed size how does it use it effectively? Idea is to come up with a correct value for SORT_AREA_SIZE parameter. Received on Sun Sep 30 2001 - 14:45:22 CDT