Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1515229
  • 博文数量: 191
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 4053
  • 用 户 组: 普通用户
  • 注册时间: 2011-03-30 13:00
个人简介

About me:Oracle ACE pro,optimistic,passionate and harmonious. Focus on ORACLE,MySQL and other database programming,peformance tuning,db design, j2ee,Linux/AIX,Architecture tech,etc

文章分类

全部博文(191)

文章存档

2026年(2)

2025年(17)

2024年(27)

2023年(28)

2022年(43)

2020年(62)

2014年(3)

2013年(9)

发布时间:2025-04-06 21:37:39

oracle分页的三种写法及其下推裁剪优化
1) 从12c开始,分页有新的fetch,offset的语法,可以和order by写一起,内部使用row_number/rank分析函数实现,with ties用rank实现
2) row_number分析函数从oracle 11g后就做了优化,可以类似普通分页写法那样,满足条件可以下推裁剪,减少数据访问量
rank分析函数可以下推

注意:dense_rank不能走索引下推优化
3)传统rownum写法裁剪优化
?......【阅读全文】

阅读(57) | 评论(0) | 转发(0)

发布时间:2025-04-06 21:14:51

1.排序键,排序要消除,才能limit裁剪,如果排序键在访问条件里更好,索引支持desc访问,如果前导列是等值,不用建desc索引
如果order by里没有前导列,要消除排序,排序列必须紧跟在等值访问条件索引后面,或者作为前导列,支持desc扫描,不用建desc索引
如果order by里有前导列,要消除排序,按order by顺序建组合索引即可,但是如果前导列非等值,则后面列如果desc,只能建desc索引


2.等值访问条件最好为前导列,就算选择性不好,也可以减少索引访问的行
3.遵循leftmost prefix规则,不能index访问的条件放到组合索引最后,可以起到index filter减少回表的作用
......【阅读全文】

阅读(83) | 评论(0) | 转发(0)

发布时间:2025-04-06 21:05:42

如果动态采样,且peeking关闭,则不管列的数据分布,会按照默认选择率计算,很容易走错索引,
需要收集统计信息。

在Oracle数据库中,优化器计算等值条件选择率时,
通常优先使用DBA_TAB_COL_STATISTICS.NUM_DISTINCT(列的统计信息)......【阅读全文】

阅读(65) | 评论(0) | 转发(0)

发布时间:2025-03-17 08:57:19

rows examined实际上是server层检查的行数,没有统计storage engine层内部处理的行数。这样很多看似是有问题的,就很好理解了,
但是,很多人把rows examined当成SQL性能的一种重要指标,认为这个是SQL扫描的行数,这就有问题了,实际上rows examined有时候
并不能准确反应storage engines扫描的行数。
......【阅读全文】

阅读(206) | 评论(0) | 转发(0)

发布时间:2025-03-16 18:26:51

在MySQL里,如果order by + limit,where或join条件还有可选索引,有可能走错索引,默认的是偏向于走order by 列索引。......【阅读全文】

阅读(129) | 评论(0) | 转发(0)
给主人留下些什么吧!~~

吻的感觉适2025-07-18 23:11

https://txc.qq.com/products/762795/blog/2019636
https://txc.qq.com/products/762801/blog/2019637
https://txc.qq.com/products/762763/blog/2019638
https://txc.qq.com/products/762772/blog/2019639
https://txc.qq.com/products/762790/blog/2019641
https://txc.qq.com/products/762758/blog/2019640
https://txc.qq.com/products/762786/blog/2019642
https://txc.qq.com/products/762782/blog/2019643
https://txc.qq.com/products/762757/blog/2019644
https://txc.qq.com/products/762805/blog/2019645
https://txc.qq.com/products/762785/blog/2019647
https://txc.qq.com/products/762815/blog/2019646
https://txc.qq.com/products/762787/blog/2019648
https://txc.qq.com/products/762799/blog/2019649
https://txc.qq.com/products/762775/blog/2019650
https://txc.qq.com/products/762759/blog/2019651
https://txc.qq.com/products/762770/blog/2019652
https://txc.qq.com/products/762855/blog/2019654

回复  |  举报

zhmw2020-05-27 16:10

tomcoding:Oracle DUL源代码,Logminer源代码,到我的博客看看

好的

回复  |  举报

zhmw2020-05-27 16:10

tomcoding:Oracle DUL源代码,Logminer源代码,到我的博客看看

好的

回复  |  举报

tomcoding2018-07-26 14:35

Oracle DUL源代码,Logminer源代码,到我的博客看看

回复  |  举报

电影vs程序员2013-08-22 18:16

博主,求加好友

回复  |  举报
留言热议
请登录后留言。

登录 注册