- 1. According to ROWID to divide <! --more-->
- select * from t_xiaoxi where rowid in(select rid from (select rownum rn,ridfrom(select rowid rid,cid from
- t_xiaoxi orderby cid desc) where rownum<10000) where rn>9980)orderby cid desc;
- select * from t_xiaoxi where rowid in(select rid from (select rownum rn,ridfrom(select rowid rid,cid from
- t_xiaoxi orderby cid desc) where rownum<10000) where rn>9980)orderby cid desc;
- Execution time 0.03 seconds
- 2. According to the analysis function
- select * from (select t.*,row_number() over(orderby cid desc) rk from t_xiaoxit) where rk<10000 and rk>9980;
- select * from (select t.*,row_number() over(orderby cid desc) rk from t_xiaoxit) where rk<10000 and rk>9980;
- Execution time 1.01 seconds
- 3. Divided by ROWNUM
- select * from(select t.*,rownum rn from(select * from t_xiaoxi orderby ciddesc) t where rownum<10000) where
- rn>9980;
- select * from(select t.*,rownum rn from(select * from t_xiaoxi orderby ciddesc) t where rownum<10000) where
- rn>9980;
- Execution time 0.1 seconds
- Where t_xiaoxi is the table name, cid is the key field of the table, take the 9981-9999th records sorted by CID in descending order, there are more than 70,000 records in the t_xiaoxi table
- Personally, I feel that 1 is the best, 3 is the second, and 2 is the worst
Oracle's paging method
Guess you like
Origin http://10.200.1.11:23101/article/api/json?id=326965498&siteId=291194637
Ranking