从8i开始,可以根据调用PL/SQL存储函数的表达式来创建索引,叫基于函数的索引(FBI),这使我们从SQL语句中调用函数时可以使用索引功能 [@more@]例如:create index student_index on students (substr(student_name,1,20)) compute statistics;
则在语句:
select * from students where substr(student_name,1,20)='Tom';
可以使用到该索引
注意:下面这几个参数必须在init.ora里边指定,否则不能启用该功能:
QUERY_REWRITE_INTEGRITY = TRUSTED
QUERY_REWRITE_ENABLED = TRUE
COMPATIBLE = 8.1.0.0.0 (or higher)
在oracle9i中则不用修改参数,直接使用基于函数的索引;
则在语句:
select * from students where substr(student_name,1,20)='Tom';
可以使用到该索引
注意:下面这几个参数必须在init.ora里边指定,否则不能启用该功能:
QUERY_REWRITE_INTEGRITY = TRUSTED
QUERY_REWRITE_ENABLED = TRUE
COMPATIBLE = 8.1.0.0.0 (or higher)
在oracle9i中则不用修改参数,直接使用基于函数的索引;
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/3898/viewspace-782742/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/3898/viewspace-782742/