最新文章专题视频专题问答1问答10问答100问答1000问答2000关键字专题1关键字专题50关键字专题500关键字专题1500TAG最新视频文章推荐1 推荐3 推荐5 推荐7 推荐9 推荐11 推荐13 推荐15 推荐17 推荐19 推荐21 推荐23 推荐25 推荐27 推荐29 推荐31 推荐33 推荐35 推荐37视频文章20视频文章30视频文章40视频文章50视频文章60 视频文章70视频文章80视频文章90视频文章100视频文章120视频文章140 视频2关键字专题关键字专题tag2tag3文章专题文章专题2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章专题3
当前位置: 首页 - 科技 - 知识百科 - 正文

【翻译自mos文章】SYS_OP_C2C导致的全表扫描(fts)/全索引扫描

来源:动视网 责编:小采 时间:2020-11-09 15:00:58
文档

【翻译自mos文章】SYS_OP_C2C导致的全表扫描(fts)/全索引扫描

【翻译自mos文章】SYS_OP_C2C导致的全表扫描(fts)/全索引扫描:SYS_OP_C2C 导致的全表扫描(fts)/全索引扫描 参考原文: SYS_OP_C2C Causing Full Table/Index Scans (Doc ID 732666.1) 适用于: Oracle Database - Enterprise Edition - Version 10.1.0.2 to 12.1.0.1
推荐度:
导读【翻译自mos文章】SYS_OP_C2C导致的全表扫描(fts)/全索引扫描:SYS_OP_C2C 导致的全表扫描(fts)/全索引扫描 参考原文: SYS_OP_C2C Causing Full Table/Index Scans (Doc ID 732666.1) 适用于: Oracle Database - Enterprise Edition - Version 10.1.0.2 to 12.1.0.1


SYS_OP_C2C 导致的全表扫描(fts)/全索引扫描 参考原文: SYS_OP_C2C Causing Full Table/Index Scans (Doc ID 732666.1) 适用于: Oracle Database - Enterprise Edition - Version 10.1.0.2 to 12.1.0.1 [Release 10.1 to 12.1] Information in this docu

SYS_OP_C2C 导致的全表扫描(fts)/全索引扫描

参考原文:
SYS_OP_C2C Causing Full Table/Index Scans (Doc ID 732666.1)

适用于:
Oracle Database - Enterprise Edition - Version 10.1.0.2 to 12.1.0.1 [Release 10.1 to 12.1]
Information in this document applies to any platform.
This problem can occur on any platform.

症状:
1)正在执行一个带有绑定变量的查询
2)绑定变量经由application(.net, j2ee等)使用 "string" 类型的绑定变量来绑定。
3)该查询错误的执行了全表扫描/索引扫描,而没有使用索引唯一扫描或者索引范围扫描
4)使用advanced 选项查看explain plan, sqltxlain or 10053 trace,你会注意到在"Predicate Information"部分 会显示一个 "filter(SYS_OP_C2C)".

e.g select * from table(dbms_xplan.display_cursor(&sql_id,null,'ADVANCED'));

Predicate Information (identified by operation id):
---------------------------------------------------
1 - filter(SYS_OP_C2C("COL1")=:B1) <=== filter operation occurring

原因:

"string" 绑定变量 与 table 中的该 column 使用了不同的数据类型
这意味着 当执行这个查询的时候,需要把数据进行一个隐式类型转换。 SYS_OP_C2C 是一个隐式函数(implicit function),该函数用于字段(列)在nchar和char之间转换

解决方案:

1. 建立一个基于函数的索引。
e.g create index on (SYS_OP_C2C());

或者:

2.让绑定变量定义的数据类型与该列的数据类型一致。
A java example where this can occurs is when defaultNChar=TRUE. This will cause strings to bind as NVARCHAR2 causing the predicate that are subset datatypes to be converted to NVARCHAR2.
e.g. -Doracle.jdbc.defaultNChar=true
true

文档

【翻译自mos文章】SYS_OP_C2C导致的全表扫描(fts)/全索引扫描

【翻译自mos文章】SYS_OP_C2C导致的全表扫描(fts)/全索引扫描:SYS_OP_C2C 导致的全表扫描(fts)/全索引扫描 参考原文: SYS_OP_C2C Causing Full Table/Index Scans (Doc ID 732666.1) 适用于: Oracle Database - Enterprise Edition - Version 10.1.0.2 to 12.1.0.1
推荐度:
标签: 文章 扫描 导致
  • 热门焦点

最新推荐

猜你喜欢

热门推荐

专题
Top