oracle中rowid高速分页解析
【摘要】
--rowid分页,第一步
select rowid rid,sal from emp order by sal desc;
--rowid分页,第二步
select rownum rn,rid
from(
select rowid rid,sal from emp order by sal desc
) where row...
--rowid分页,第一步
select rowid rid,sal from emp order by sal desc;
select rowid rid,sal from emp order by sal desc;
--rowid分页,第二步
select rownum rn,rid from( select rowid rid,sal from emp order by sal desc ) where rownum<10;
select rownum rn,rid from( select rowid rid,sal from emp order by sal desc ) where rownum<10;
--rowid分页,第三步
select rid from(select rownum rn,rid from(select rowid rid,sal from emp order by sal desc) where rownum<10) where rn>5;
select rid from(select rownum rn,rid from(select rowid rid,sal from emp order by sal desc) where rownum<10) where rn>5;
--rowid分页,第四步
select * from emp where rowid in(select rid from(select rownum rn,rid from(select rowid rid,sal from emp order by sal desc) where rownum<10) where rn>5);
select * from emp where rowid in(select rid from(select rownum rn,rid from(select rowid rid,sal from emp order by sal desc) where rownum<10) where rn>5);
****************************************************
第一层:获取数据物理地址
第二层:取得最大页数
第三层:取得最小页数
第四层:因为取得的页数都是物理地址,再根据物理地址,插叙出具体数据
文章来源: bugstack.blog.csdn.net,作者:小傅哥,版权归原作者所有,如需转载,请联系作者。
原文链接:bugstack.blog.csdn.net/article/details/7766982
【版权声明】本文为华为云社区用户转载文章,如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱:
cloudbbs@huaweicloud.com
- 点赞
- 收藏
- 关注作者
评论(0)