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)
发布时间:2024-05-08 09:12:57
本文主要讲解,如何建立高效的索引,减少io提高效率,建立组合索引要从哪些方面考虑,从索引访问的路径,访问规则以及索引io计算公式等方面分析。
索引访问过程三步骤:index access,index filter,backward to table(索引访问、索引过滤、回表),
索引访问过程中的选择率ix_sel:也叫effective index selectivity,
是真正用于index access的列的选择率,要遵循leftmost prefix访问规则,ix_sel决定索引访问的cost
索引访问过程中的ix_sel_with_filters:也叫effective table selectivity,
这是访问过程中不遵循leftmost prefix访问规则的列用于索引访问过滤。ix_sel_with_filters不用于计算索引访问的cost
ix_sel和ix_sel_with_filters共同决定了索引扫描最终返回的行数
backward to table回表过滤也有两种选择率:
1)effective......【阅读全文】
发布时间:2024-05-08 17:28:28
本文主要讲解,如何建立高效的索引,减少io提高效率,建立组合索引要从哪些方面考虑,从索引访问的路径,访问规则以及索引io计算公式等方面分析。
索引访问过程三步骤:index access,index filter,backward to table(索引访问、索引过滤、回表)
......【阅读全文】
发布时间:2024-05-08 17:07:57
经常碰到一些分区表里的分区统计信息num_rows=0,从而导致执行计划不准,特别是笛卡尔积。这个主要是灌入了数据,
未及时更新分区统计信息。
另外,没有数据的分区,不要收集统计信息,也就不会导致num_rows=0的问题,就算有数据,未收集分区统计信息,内部
也会采样,比较准确。
为什么导致num_rows=0,这个主要和收集统计信息的语句有关:
1)一般的收集语句,没有指定pname,会导致num_rows=0问题
exec dbms_stats.gather_table_stats(ownname => user,tabname=>'part_tab',no_invalidate => false);
2)指定pname,会收集指定分区统计信息,也会更新全局表统计信息,不会有num_rows=0问题,
未收集的分区如果有数据,内部会采样,比较准确,比num_rows好。
......【阅读全文】
发布时间:2024-05-06 15:29:59
本文主要讲解如何从一个表里快速随机获取前N行的方法,用最少IO,利用索引的快速扫描,快速从表里获取随机的前N行数据。
......【阅读全文】
发布时间:2024-04-29 09:14:53
一般情况下LIKE查询有三种情况:
1)%后通配可以走INDEX RANGE SCAM,
2)%前通配不能走INDEX RANGE SCAN,如果数据不能全部从索引里获取,还需要回表,则走全表扫描
3)%前通配不能走INDEX RANGE SCAN,如果数据全部从索引里获取可以走INDEX FAST FULL SCAN
......【阅读全文】
吻的感觉适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