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)
发布时间:2025-04-26 18:19:17
mysql执行计划里索引访问算子和oracle的不同之处
1.mysql Index range scan算子包括index access,index filter(ICP),回表不带过滤的时间,
如果有额外的过滤条件,有Filter算子,过滤时间算在这里面。
ICP如果能大幅度减少回表的行,也就减少了回表的随机IO,则效率提升明显。
2.估算的rows实际上是访问方法扫描的行数,对应普通explain的rows,不包括ICP以及回表过滤filtered,不是结果行数,
这个实际上和oracle不一样,oracle的rows/cardinality是整个条件结果行数
3.mysql的analyze的actual rows则包括过滤条件,所以估算的rows和actual rows实际上标准不统一,是缺陷
通过估算的rows可以看到索引index access效率,比如访问行数多,则效率低,然后actual rows少,说明要么走ICP,要么组合索引顺序非最佳
index访问,过滤,回表效率比较:ind......【阅读全文】
发布时间:2025-04-26 18:11:55
对于不能merge的view/derived table/ct
mysql不支持jppd谓词推入,只支持单独的过滤谓词推入到view里,只支持单独过滤谓词推入到union all视图(mysql8支持)、group by等视图里,
不支持join谓词推入不能merge的视图,比如union all视图,group by视图里
mysql join谓词不能推入到union all视图里,直接materialize化,性能差
......【阅读全文】
发布时间:2025-04-26 18:04:04
对子查询的优化处理能力,oracle > pg > mysql,mysql的子查询有不少优化,但是还是有很多问题。
子查询的原始语义是:
只返回主表结果,子查询只是用来进行存在性判断。
从这点看,如果子查询要转为普通join,要么join key有唯一键,要么子查询结果按照join key剔重,当然anti join不需要,
一般anti join不会自动改成left join+inner.id is null,但是可以手动实现,这种只查找不匹配的,不需要子查询join key唯一。
像ORACLE的子查询做成view然后hash unqiue就是剔重转为普通join,像MySQL的materialization,loose scan,pull out,dupsweedout都有各种
按照join key对子查询剔重的动作。......【阅读全文】
发布时间:2025-04-26 16:56:01
Oracle 12c引入的TABLE ACCESS BY INDEX ROWID BATCHED技术是一种针对索引回表操作的优化机制,旨在减少回表过程中的物理I/O开销和资源消耗。以下从技术原理、作用、优缺点及适用场景等方面详细分析该技术。
??
?为了减少回表过滤次数,减少逐行回表,减少表数据块访问次数和index clustering factor影响,
oracle 12c推出了table access by index rowid batched,可以批量rowid回表,先索引访问,
查出rowid,然后排序,批量回表查找,避免多次回表过滤
和index clustering factor影响多次查询表数据块。。。
这时候,就不是逐行回表了,而且批量回表可能会导致索引不能消除排序,
还有批量回表,索引查找可以使用并行,请详细分析12c的batched回表技术,
解析其作用,和单行回表相比的优缺点......【阅读全文】
发布时间:2025-04-26 16:35:20
对于使用了函数或表达式运算会导致统计信息用不上、and条件列组相关性紧密,这些情况下的cardinality可能计算不准,
导致多表JOIN的join order、join method选择不对,从而走错执行计划,这时候可以使用扩展列统计信息来优化cardinality计算。......【阅读全文】
吻的感觉适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