select /*+index(h)*/e,f,f into v_e,v_f,v_f
   from Table 
  where (f between substr(y,1,4)||'01' 
               and substr(y,1,4)||'12')
    and e=x
    and g=z;
应该会快点

解决方案 »

  1.   


      where (f between substr(y,1,4)||'01' and substr(y,1,4)||'12')
        and e=x
        and g=z;
    条件按照上边的写没错,关键是(f between substr(y,1,4)||'01' and substr(y,1,4)||'12')这一句永不上索引的,所以你的索引应该只建立(g,e)就行了,只要(g,e)能够确定的范围很小就能够速度很快
      

  2.   

    你使用了substr,但你的索引只对字段建立,所以你用不上,你可以照楼上方法改进,也可以建一个函数索引。