读书人

关于数据库索引的有关问题~求教

发布时间: 2012-02-28 13:06:36 作者: rapoo

关于数据库索引的问题~求教~
数据库索引的优缺点是什么?什么是合理索引。以下语句涉及内容均建立了索引,请问其操作是否效率高?如果不是,请写出效率高的方式?
a select content from record where substring(card_no,1,4)='5378'
b select content from record where amount/30=1000
c select content from record where convert(char(10),data,112)='19990513'

对索引实在不解,看了相关资料还是不知道怎么去分辨效率高低问题,请懂的朋友告知~~

[解决办法]

a select content from record where substring(card_no,1,4)='5378'
select content from record where card_no like '5378%'

b select content from record where amount/30=1000
select content from record where amount=1000*30

c select content from record where convert(char(10),data,112)='19990513'
select content from record where data>='19990513' and data<'19990514'



[解决办法]

探讨
a select content from record where substring(card_no,1,4)='5378'
select content from record where card_no like '5378%'

b select content from record where amount/30=1000
select content from record……

读书人网 >SQL Server

热点推荐