1. 程式人生 > >oracle 分頁效能

oracle 分頁效能

使用者表T_DB_USERS,記錄數60萬

分頁語句一:

select t.*,rawtohex(SYS_GUID()) mmm_guid from ( select a.*,rownum rn from T_DB_USERS a) t where rn>10 and rn<=30;

執行時間 0.281 秒

分頁語句二:

select t.*,rawtohex(SYS_GUID()) mmm_guid from ( select a.*,rownum rn from T_DB_USERS a where rownum<=30) t where rn>10
;

執行時間 0.031 秒

第二種比第一種快了不少