注册

函数索引不生效

夜未眠风已息 2023/08/19 725 2

为提高效率,提问时请提供以下信息,问题描述清晰可优先响应。
【DM版本】: DM8
【操作系统】:
【CPU】:
【问题描述】*:

--创建表和数据
create table DMHR.t_index(ci int ,cv varchar2(100));

begin
	for i in 10001..100000 loop
	 insert into t_index values(i,to_char(i));
	 if mod(i,1000)=0 then
	 	commit;
	 end if;
	end loop;
	commit;
end;
--创建索引
CREATE INDEX DMHR.T_INDEX_IDX ON DMHR.T_INDEX (substr(CV,1,2));
--查询计划
explain SELECT * FROM DMHR.T_INDEX WHERE CV='12'

--执行计划为走到T_INDEX_IDX索引
1   #NSET2: [12, 2500, 64] 
2     #PRJT2: [12, 2500, 64]; exp_num(3), is_atom(FALSE) 
3       #SLCT2: [12, 2500, 64]; T_INDEX.CV = '12'
4         #CSCN2: [12, 100000, 64]; INDEX33555648(T_INDEX)

回答 0
暂无回答
扫一扫
联系客服