function-based indx
用途:建立在函数上的查询可以通过函数索引加快查询速度
缺点:会增加DML的cost
要点:1)只用在CBO模式,表要经过分析
2)需要设置参数,无论是system或者是session级别
QUERY_REWRITE_ENABLED=TRUE
QUERY_REWRITE_INTEGRITY=TRUSTED
3)自定义函数必须声明
DETERMINISTIC关于要点2,实验中的结果是可不必设置这两个参数,9i环境sys@FOX> show parameter query
NAME TYPE VALUE
------------------------------------ ----------- -----------------
query_rewrite_enabled string FALSE
query_rewrite_integrity string enforced
sys@fox>create index idx_owner on tx(upper(owner));
sys@FOX> select * from tx where upper(owner)='T';
OWNER STATUS
------------------------------ -------
t VALID
t VALID
T VALID
Execution Plan
----------------------------------------------------------
0 SELECT STATEMENT Optimizer=CHOOSE (Cost=2 Card=3 Bytes=33)
1 0 TABLE ACCESS (BY INDEX ROWID) OF 'TX' (Cost=2 Card=3 Bytes=33)
2 1 INDEX (RANGE SCAN) OF 'IDX_OWNER' (NON-UNIQUE) (Cost=1 Card=3)
阅读(648) | 评论(0) | 转发(0) |