Last active
August 29, 2015 14:06
-
-
Save fuzhengwei/d7bb843332e717e01ced to your computer and use it in GitHub Desktop.
oracle中rowid高速分页解析
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--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 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; | |
--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); | |
**************************************************** | |
第一层:获取数据物理地址 | |
第二层:取得最大页数 | |
第三层:取得最小页数 | |
第四层:因为取得的页数都是物理地址,再根据物理地址,插叙出具体数据 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment