Oracle在执行自隐式转换时:总是会把字符串转为数字,字符串转为日期。当列进行转换,会跳过索引,降低性能。

  1. 创建一个表格,给三个列建立索引,进行测试。
create table t1(n1 number, v1 varchar2(10), d1 date);

insert into t1
  select
        rownum n1
      , rownum v1
      , sysdate + dbms_random.value(0,365)
  from
        dual
connect by level <= 1e3;


create index t1_n1_idx on t1(n1);
create index t1_v1_idx on t1(v1);
create index t1_d1_idx on t1(d1);
View Code

相关文章:

  • 2021-10-21
  • 2022-12-23
  • 2022-12-23
  • 2021-11-16
  • 2021-12-12
  • 2021-05-11
猜你喜欢
  • 2021-12-25
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-27
  • 2021-09-17
相关资源
相似解决方案