SORT ORDER BY STOPKEY
select * from
(
select * from
(
select a.*,rownum rn
from page a
where object_id >1000 and owner='SYS'
order by object_id desc
) where rownum<=20
) where rn>=20; 现在加个HINT SQL> select * from table(dbms_xplan.display_cursor(null,null,'ALLSTATS LAST')); PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------
SQL_ID 9w6p4hu1q1z4n, child number 0
-------------------------------------
select * from ( select * from ( select /*+ index(a) */ a.*,rownum rn from page a where object_id >1000 and owner='SYS'
order by object_id desc ) where rownum<=20 ) where rn>=0 Plan hash value: 3486388599 ------------------------------------------------------------------------------------------------------------------------------------
| Id | Operation | Name | Starts | E-Rows | A-Rows | A-Time | Buffers | OMem | 1Mem | Used-Mem |
------------------------------------------------------------------------------------------------------------------------------------
|* 1 | VIEW | | 1 | 20 | 20 |00:00:01.28 | 739 | | | |
|* 2 | COUNT STOPKEY | | 1 | | 20 |00:00:01.28 | 739 | | | |
| 3 | VIEW | | 1 | 22595 | 20 |00:00:01.28 | 739 | | | |
|* 4 | SORT ORDER BY STOPKEY | | 1 | 22595 | 20 |00:00:01.28 | 739 | 1234K| 574K| 1096K (0)|
| 5 | COUNT | | 1 | | 22130 |00:00:01.22 | 739 | | | |
| 6 | TABLE ACCESS BY INDEX ROWID| PAGE | 1 | 22595 | 22130 |00:00:01.22 | 739 | | | |
|* 7 | INDEX RANGE SCAN | IDX_PAGE_3 | 1 | 22595 | 22130 |00:00:01.20 | 150 | | | |
------------------------------------------------------------------------------------------------------------------------------------ Predicate Information (identified by operation id):
--------------------------------------------------- 1 - filter("RN">=0)
2 - filter(ROWNUM<=20)
4 - filter(ROWNUM<=20)
7 - access("OBJECT_ID">1000 AND "OWNER"='SYS' AND "OBJECT_ID" IS NOT NULL)
filter("OWNER"='SYS') |* 4 | SORT ORDER BY STOPKEY | | 1 | 22595 | 20 | SORT ORDER BY STOPKEY 是指: 排序过后取数据 走索引后返回 100w条 是不是要对100w排序
SORT ORDER BY STOPKEY的更多相关文章
- U3D sorting layer, sort order, order in layer, layer深入辨析
1,layer是对游戏中所有物体的分类别划分,如UIlayer, waterlayer, 3DModelLayer, smallAssetsLayer, effectLayer等.将不同类的物体划分到 ...
- ECshop网点程序优化-后台添加类目自动选择上次父类目并计算Sort Order
如果在ECshop后台批量添加过大量类目的人都能体会到是多么的不方便(这点还是要说一下ECshop的产品经理,细节上还是要多注意),每次添加都需要在几百个类目里面找到要添加的父类目也是一个麻烦事,比如 ...
- Custom Sort Order
When trying to sort based on values that do not fit the standard ascending and descending sort logic ...
- R语言排序 -- sort() order() rank()
order() 的返回值是对应“排名”元素所在向量中的位置.注意返回的不是元素本身,而是元素的位置. sort() 是直接对向量中的元素进行排序,返回的是排序后的元素组成的向量. rank() 是求秩 ...
- Easyui 排序时 自动向后排传sort order 你妹真坑爹
request 的时候 发现 sort 竟然是个数组!
- Oracle no TOP, how to get top from order
On ROWNUM and Limiting Results Our technologist explains how ROWNUM works and how to make it work fo ...
- Oracle 分页原理
oracle rownum 及分页处理的使用方法 在实际应用中我们经常碰到这样的问题,比如一张表比较大,我们只要其中的查看其中的前几条数据,或者对分页处理数据.在这些情况下我们都需要用到rownum. ...
- 子查询解嵌套in改写为exists
SELECT * FROM (SELECT pubformdat0_.id id332_, pubformdat0_.domain_id domain2_332_, pubformdat0_.proc ...
- Oracle ROWNUM用法和分页查询总结(转)
[转载] Oracle的分页查询语句基本上可以按照本文给出的格式来进行套用. Oracle分页查询格式(一):http://yangtingkun.itpub.net/post/468/100278 ...
随机推荐
- block没那么难(二):block和变量的内存管理
本系列博文总结自<Pro Multithreading and Memory Management for iOS and OS X with ARC> 了解了 block的实现,我们接着 ...
- json-lib-2.4-jdk15.jar maven
最近自己将一个web项目装换到使用mevan自动管理. 遇到了一个json包导入的问题.最终解决如下: <!-- https://mvnrepository.com/artifact/net.s ...
- RHEL7安装配置TigerVNC
TigerVNC使用非加密的链接,默认会被firewalld blocked 掉,想要 vnc正常工作就需要让firewalld开放相应的端口才行. vnc默认的端口号为5900,而每个vnc win ...
- codevs1506传话(kosaraju算法)
- - - - - - - - 一个()打成[] 看了一晚上..... /* 求强连通分量 kosaraju算法 边表存图 正反构造两个图 跑两边 分别记下入栈顺序 和每个强连通分量的具体信息 */ ...
- Mongodb 启动时 lock文件访问没有权限处理
mongodb 第二次启动时候异常信息: lock file: /data/db/mongod.lock errno:13 Permission denied Is a mongod instance ...
- Two ways to create file using 'doc'.
Here are two ways to create file using 'doc' command: Method i: copy con [file name][enter key] [con ...
- NSNumber 转 NSString
之前number 转string时候调用stringValue,后来发现未完全转 NSNumber * a_num = [NSNumber numberWithInteger: ]; NSString ...
- [中级] 有效删除URL中的index.php
如果你刚接触CI不久又或者刚刚研读CI的使用手册的话,关于如何有效删除URL中index.php以使URL看起来更友好美观的问题,可能是你面对的第一个较为复杂的问题!本贴不是原创,而是一个各种意见的综 ...
- Spring与Jdbc Demo
方法一:继承JdbcTemplate来实现 1.配置applicationContext <!-- 获取数据源连接 dbcp --> <bean id="dataSourc ...
- busybox下mount nfs的命令
busybox下mount nfs的命令 mount -f nfs -o nolock 10.130.30.2:/nfs/nuc970/rootfs /mnt/test