declare
i             integer;
int1          integer;
t1            number;
t2            number;
t_all         number;
t_select      number;
execute_count number := 10;
function getnumfromtimestamp(iTime timestamp) return number is
Result        number;
v_hour        number;
v_minute      number;
v_second      number;
v_millisecond number;
begin
v_hour   := EXTRACT(hour from iTime);
v_minute := EXTRACT(minute from iTime);
v_second := EXTRACT(second from iTime);
Result   := (v_hour + 1) * 3600 + (v_minute + 1) * 60 + v_second;
return(Result);
end;
begin
select count(*)
into int1
from (select rn
from (select (mod(rownum?? 3) * 3 - 1) * 1000000 + rownum rn
from dual
connect by rownum <= 1000000
order by rn) c
where rownum + 1 < 10000000);
t1 := getnumfromtimestamp(systimestamp);
for i in 1 .. execute_count loop
select count(*)
into int1
from (select rn
from (select (mod(rownum?? 3) * 3 - 1) * 1000000 + rownum rn
from dual
connect by rownum <= 1000000
order by rn) c
where rownum + 1 < 10000000);
end loop;
t2    := getnumfromtimestamp(systimestamp);
t_all := t2 - t1;
select count(*)
into int1
from (select rn
from (select (mod(rownum?? 3) * 3 - 1) * 1000000 + rownum rn
from dual
connect by rownum <= 1000000) c
where rownum + 1 < 10000000);
t1 := getnumfromtimestamp(systimestamp);
for i in 1 .. execute_count loop
select count(*)
into int1
from (select rn
from (select (mod(rownum?? 3) * 3 - 1) * 1000000 + rownum rn
from dual
connect by rownum <= 1000000) c
where rownum + 1 < 10000000);
end loop;
t2       := getnumfromtimestamp(systimestamp);
t_select := t2 - t1;
dbms_output.put_line('sort_times:' ||
trunc(18792428 / 1000 / ((t_all - t_select))));
end;
/

??????????£?
????1?????????????CPU????????????????????????????????????????????????????????????С??
????2??????PC????????????INTEL??AMD CPU???????????????????????????С???POWER5??Itanium CPU?????????????????μ?POWER6??POWER7???????????????POWER6??POWER7???????
????3????????CPU INTEL E8400??3G???? PC?????????XEON E5520??2.26G?????????????????CPU?????????????PC??????CPU???????????????CPU????????????Щ????????????????????????????????CPU?????????????????????????????????????????2????????????????4??????????????????????????????????????????????????????CPU???·???д?????濼???????
????4??AMD??CPU?????????????AMD Opteron 2378(45nm) ??AMD Opteron 2356(65nm) ?????????Cache?????????????????????AMD??CPU?????????????????????С?
????5??Oracle9i??????????????nlog(n)??Oracle10g??????????з??????????????????????С??nlog(n)??
????6??С???CPU???????????κ??????С????????????
??????????????????С??????????????崻???PC?????????????????
???????????????С????????????????????????????PC??????????????????
???????????????С?????CPU?????????????64???????PC????????????????16?????
??????????
??????????????С?????????????????????С????????????????????????????????????????PC??????????????????????????????÷????????????????????????INTEL CPU Core i7?????á?
????Oracle10g??Oracle9i????????RAC???????IO?????????д???????????????Щ?????????ú???籾?β????е?hash???????????????????????????????????CPU??????IO??????????Oracle9i??????Oracle10g??11g?????Щ??????
???????????????CPU?????????????????????????????????????????????вο????????????????????????????д?????????????????????????????Щ?ο????壬?ó???????????????????