发信人: saho (向日葵), 信区: Database
标 题: Re: 问一个Oralce index的问题
发信站: BBS 未名空间站 (Tue May 22 15:33:37 2007)
you are right on that. 'A%' is a little bit special, you will get a index
range scan. The statement give him an index full scan due to "Select last_
name from ...". It will give a index range scan if the upper() function
index is built or the upper() clause is removed.
【 在 q101 (^(?:[DX]?HT|X|YA)ML$) 的大作中提到: 】
: I think the main problem is the upper() function, since you indexed
: the value of "last_name" instead of the value of upper(last_name).
: "like" clause should be OK. coz you use "A%" instead of "%A" or
: "%A%", you can use index anyway.
: my 2 cents,
※ 来源:·WWW 未名空间站 海外: mitbbs.com 中国: mitbbs.cn·[FROM: 209.243.]