当前在线人数13754
首页 - 分类讨论区 - 电脑网络 - 数据库版 -阅读文章
未名交友
[更多]
[更多]
文章阅读:Re: 问一个Oralce index的问题
[同主题阅读] [版面: 数据库] [作者:saho] , 2007年05月21日16:06:20
saho
进入未名形象秀
我的博客
[上篇] [下篇] [同主题上篇] [同主题下篇]

发信人: saho (向日葵), 信区: Database
标  题: Re: 问一个Oralce index的问题
发信站: BBS 未名空间站 (Mon May 21 16:06:20 2007)

You actually don't have any benefit of index by using 'like'.

If you use select * from employees where upper(last_name) like 'JO%';
It will be gaurantee a full table access.

In your statement,
select last_name from employees where upper(last_name) like 'JO%';
Most likely, if you have an index built on last_name, you will have full
index scan which doesn't do any better performance.

avoid to use 'like' unless you absolutely have to or the table is small and
it's definitely not scalable in the future.

【 在 yiyayiyayo (Mera naam Itiaan hai) 的大作中提到: 】
: 比如说:
: select last_name from employees where upper(last_name) like 'JO%';
: 有没有创建一个index在last_name上,我们肉眼根本看不出区别的吧,是不是?



--


※ 来源:·WWW 未名空间站 海外: mitbbs.com 中国: mitbbs.cn·[FROM: 209.243.]

[上篇] [下篇] [同主题上篇] [同主题下篇]
[转寄] [转贴] [回信给作者] [修改文章] [删除文章] [同主题阅读] [从此处展开] [返回版面] [快速返回] [收藏] [举报]
 
回复文章
标题:
内 容:

未名交友
将您的链接放在这儿

友情链接


 

Site Map - Contact Us - Terms and Conditions - Privacy Policy

版权所有,未名空间(mitbbs.com),since 1996