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)
发布时间:2022-04-12 10:28:15
因为优化器还不够强大,还有很多限制,或者因为一些逻辑原因,分析认为SQL要走正确的索引比较好,但是事实却无法正确利用索引。
这时候,写的SQL必须除了统计信息之外,要能够给优化器足够多的其他需要的信息,让优化器能够选择更好的执行计划。......【阅读全文】
发布时间:2026-03-30 17:44:51
ORACLE和MySQL的hash join,如果hash table返回0行,则probe table不需要执行,执行次数是0,而PG的还会执行,hash table a返回0行,但是probe table b还要执行,只不过最多只扫描满足条件的一行去探测,发现hash table没有数据,后面的不再探测
......【阅读全文】
发布时间:2026-03-30 14:27:55
oracle的外连接where内表过滤条件是函数,包括自定义函数,没有其他额外非函数的过滤条件,则不能转为inner join,只能走外连接,然后外层FILTER过滤where条件,一般来说,效率比inner join低,增加 内表条件 is not null 则可以转为inner join,数学运算可以转为inner join......【阅读全文】
发布时间: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-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