8i和9i都提供了表达式索引Function-based indexes, which are based on expressions. They enable you to construct queries that evaluate the value returned by an expression, which in turn may include functions (built-in or user-defined). The following statements creates a function-based index on the emp table based on an uppercase evaluation of the ename column: CREATE INDEX emp_i ON emp (UPPER(ename)); 
To ensure that Oracle will use the index rather than performing a full table scan, be sure that the value of the function is not null in subsequent queries. For example, the statement SELECT * FROM emp WHERE UPPER(ename) IS NOT NULL
   ORDER BY UPPER(ename);建立一个substr(id,x,y)的函数索引

解决方案 »

  1.   

    也可以建立instr(id,'date')函数索引
    select * from table_name where instr(id,'date')>1;
    注意使用函数索引要设置init.ora
    query_rewrite_enabled=true
      

  2.   

    能利用substr(id,x,y)来建立索引吗?
      

  3.   

    to developer2002(开发者2002) good idea
      

  4.   

    to beckhambobo(beckham):
    “也可以建立instr(id,'date')函数索引”要如何建立啊
      

  5.   

    要oracle8i的才能建基于函数的索引,oracle8.05好象没有这个功能