分页SQL取下一页
20条记录一页,扫描第2页就需要访问40条记录。 SQL> select * from ( select * from ( select /*+ index_desc(a idx_page_3) */ a.*,rownum rn from page
a where object_id >1000 and owner='SYS' order by object_id desc ) where rownum<=40 ) where
rn>=21 2 3
4 ; SQL> select * from table(dbms_xplan.display_cursor(null,null,'ALLSTATS LAST')); PLAN_TABLE_OUTPUT
------------------------------------------------------------------------------------------------------------------------------------------------------------ --------------------------------------------
SQL_ID bwcbf54a6h4th, child number 1
-------------------------------------
select * from ( select * from ( select /*+ index_desc(a idx_page_3) */
a.*,rownum rn from page a where object_id >1000 and owner='SYS'
order by object_id desc ) where rownum<=40 ) where rn>=21 Plan hash value: 3526010999 ---------------------------------------------------------------------------------------------------------
| Id | Operation | Name | Starts | E-Rows | A-Rows | A-Time | Buffers |
---------------------------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | | 20 |00:00:00.01 | 10 |
|* 1 | VIEW | | 1 | 40 | 20 |00:00:00.01 | 10 |
|* 2 | COUNT STOPKEY | | 1 | | 40 |00:00:00.01 | 10 |
| 3 | VIEW | | 1 | 30556 | 40 |00:00:00.01 | 10 |
| 4 | COUNT | | 1 | | 40 |00:00:00.01 | 10 |
| 5 | TABLE ACCESS BY INDEX ROWID | PAGE | 1 | 30556 | 40 |00:00:00.01 | 10 |
|* 6 | INDEX RANGE SCAN DESCENDING| IDX_PAGE_3 | 1 | 30556 | 40 |00:00:00.01 | 4 |
--------------------------------------------------------------------------------------------------------- Predicate Information (identified by operation id):
--------------------------------------------------- 1 - filter("RN">=21)
2 - filter(ROWNUM<=40)
6 - access("OBJECT_ID" IS NOT NULL AND "OBJECT_ID">1000 AND "OWNER"='SYS')
filter("OWNER"='SYS') 28 rows selected. SQL> select * from table(dbms_xplan.display_cursor(null,null,'ALLSTATS LAST')); PLAN_TABLE_OUTPUT
------------------------------------------------------------------------------------------------------------------------------------------------------------ --------------------------------------------
SQL_ID 6gay6kkxxsqgw, child number 0
-------------------------------------
select * from ( select * from ( select /*+ index_desc(a idx_page_3) */
a.*,rownum rn from page a where object_id >1000 and owner='SYS'
order by object_id desc ) where rownum<=60 ) where rn>=41 Plan hash value: 3526010999 ---------------------------------------------------------------------------------------------------------
| Id | Operation | Name | Starts | E-Rows | A-Rows | A-Time | Buffers |
---------------------------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | | 20 |00:00:00.01 | 11 |
|* 1 | VIEW | | 1 | 60 | 20 |00:00:00.01 | 11 |
|* 2 | COUNT STOPKEY | | 1 | | 60 |00:00:00.01 | 11 |
| 3 | VIEW | | 1 | 30556 | 60 |00:00:00.01 | 11 |
| 4 | COUNT | | 1 | | 60 |00:00:00.01 | 11 |
| 5 | TABLE ACCESS BY INDEX ROWID | PAGE | 1 | 30556 | 60 |00:00:00.01 | 11 |
|* 6 | INDEX RANGE SCAN DESCENDING| IDX_PAGE_3 | 1 | 30556 | 60 |00:00:00.01 | 4 |
--------------------------------------------------------------------------------------------------------- Predicate Information (identified by operation id):
--------------------------------------------------- 1 - filter("RN">=41)
2 - filter(ROWNUM<=60)
6 - access("OBJECT_ID" IS NOT NULL AND "OBJECT_ID">1000 AND "OWNER"='SYS')
filter("OWNER"='SYS') 28 rows selected.
分页SQL取下一页的更多相关文章
- PHPCMSv9首页显示分页点击下一页跳转链接出现错误,跳转到后台的解决方案
1 引用页写为 {pc:content action="lists" catid="10" order="updatetime DESC" ...
- 【asp.net爬虫】asp.NET分页控件抓取第n页数据 javascript:__doPostBack
最近在模拟HTTP请求抓取数据,但是服务器是asp.net开发的 分页控件代码 <tr> <td align="left">共 210&am ...
- python实现一个栏目的分页抓取列表页抓取
python实现一个栏目的分页抓取列表页抓取 #!/usr/bin/env python # coding=utf-8 import requests from bs4 import Beautifu ...
- 2016/3/27 分页 共X条数据 本页x条 本页从x-y条 x/y页 首页 上一页 123456 下一页 末页 pagego echo $page->fpage(7,6,5,4,3,2,1,0);
显示效果: fpage.class.php <?php /** file: page.class.php 完美分页类 Page */ class Page { private $total; / ...
- 原生JS实现分页效果2.0(新增了上一页和下一页,添加当前元素样式)
虽然写的很烂,但至少全部都是自己写的,因为这个没有固定的顺序,所以就没有封装,如果你技术好的话,可以你写的分享给我,谢谢. <!DOCTYPE html><html lang=&qu ...
- php按条件查询的数据分页显示,点击下一页时又列出全部数据的解决办法
其实很简单,只要把表单提交方式改为get方式就行了,然后调用分页函数: function getpage(&$m,$where,$pagesize=10){ $m1=clone $m;//浅复 ...
- extjs4 分页工具栏pagingtoolbar的每页显示数据combobox下拉框
var itemsPerPage = 20; var combo; //创建数据源store Ext.define('recordStore', { extend : 'Ext.data.Store' ...
- HTML静态分页(形如:首页,上一页,下一页,尾页)
在HTML中有时候我们会用到静态分页,一次拿回一定量的数据结果条目,我们会以形如:第2页,共12页 首页 上一页 下一页 尾页 的方式进行静态分页,以下是该种静态分页的代码,供兄弟姐妹们参考. &l ...
- 使用selenium webdriver+beautifulsoup+跳转frame,实现模拟点击网页下一页按钮,抓取网页数据
记录一次快速实现的python爬虫,想要抓取中财网数据引擎的新三板板块下面所有股票的公司档案,网址为http://data.cfi.cn/data_ndkA0A1934A1935A1986A1995. ...
随机推荐
- Qt 学习之路:线程总结
前面我们已经详细介绍过有关线程的一些值得注意的事项.现在我们开始对线程做一些总结. 有关线程,你可以做的是: 在QThread子类添加信号.这是绝对安全的,并且也是正确的(前面我们已经详细介绍过,发送 ...
- [转] Linux strace 简介
http://www.cnblogs.com/ggjucheng/archive/2012/01/08/2316692.html 简介 strace常用来跟踪进程执行时的系统调用和所接收的信号. 在L ...
- linux reboot命令
命令简介: 该命令用来重启Linux系统.相当于Windows系统中的restart命令. 命令语法: /sbin/reboot [-n] [-w] [-d] [-f] [-i] 或 reboot [ ...
- 给Sublime Text2安装轻量级代码提示插件:SublimeCodeIntel
步骤: 1.下载SublimeCodeIntel(地址https://github.com/SublimeCodeIntel/SublimeCodeIntel): 2.将下载的压缩包解压,并放置在Pa ...
- document.documentElement.style判断浏览器是否支持Css3属性
1.document.documentElement.style 属性定义了当前浏览器支持的所有Css属性 包括带前缀的和不带前缀的 例如:animation,webkitAnimation,msAn ...
- jquery,javascript -设置某一ul下的li下的 a的属性
//javascriptvar ul = document.getElementById('ul); var as = ul.getElementsByTagName('a'); for(var i ...
- jquery选择器的使用方式
1.基本选择器 选择器 描述 返回 示例 代码说明 1 id选择器 根据指定的id匹配元素 单个元素 $("#one").css("background", ...
- exp/imp 有很多弊端
弊端1. 空表 无法执行导出操作弊端2. 高版本的导出文件 无法使用 低版本的 oracle软件 导入 环境准备:create table test0707(n1 date); 认证弊端1 案例1. ...
- 104. Maximum Depth of Binary Tree(C++)
104. Maximum Depth of Binary Tree Given a binary tree, find its maximum depth. The maximum depth is ...
- 自己制作精美的App Store 软件截屏
当用户搜索到App的时候,一般都会先看截图,如果截图效果不好,可能用户就不会下载. 不想自己辛苦写的认为还不错的软件,因为截图的原因,而降低了很多下载量吧. 轻轻松松做出这样高大上的截屏效果来. Sc ...