I have a table containing production information that your users query frequently, They specifically use this
query most often (that is only use name to search in the where condition):
SELECT Name,Description,Vendor,Instock,Price FROM Products where Name='Jerry'--(查询时where后面只有Name这个条件)Have a nonclustered index on this table on the Name column,but your users are complaining the query is still too slow,what can you do to speed it up?A、modify the index to include the Description,vendor,Instock, and price columns as nonkey columns.
B、Create a new nonclustered index on the Description,vendor,Instock, and price as nonkey columns.
C、Create a new clustered index on the Description,vendor,Instock, and price as nonkey columns.
D、You can't do anything to speed up this query.数据库是SQL SERVER,请问哪个答案是对的,请给出理由,谢谢。
query most often (that is only use name to search in the where condition):
SELECT Name,Description,Vendor,Instock,Price FROM Products where Name='Jerry'--(查询时where后面只有Name这个条件)Have a nonclustered index on this table on the Name column,but your users are complaining the query is still too slow,what can you do to speed it up?A、modify the index to include the Description,vendor,Instock, and price columns as nonkey columns.
B、Create a new nonclustered index on the Description,vendor,Instock, and price as nonkey columns.
C、Create a new clustered index on the Description,vendor,Instock, and price as nonkey columns.
D、You can't do anything to speed up this query.数据库是SQL SERVER,请问哪个答案是对的,请给出理由,谢谢。
解决方案 »
- 我想从sstatus中找出mfgordername='KK' 的LOTnm 再与TTCOA里的LOTNM相关联,该怎么联啊
- 救命啊!请问数据库里的存储过程被删除后有没有办法恢复啊
- 装不了SQL SERVER 怎么办 急急急........
- 我已经有了表的一个字段的所有数值,怎么批量更新啊?
- Adventureworks示例数据库附加后,居然查不出数据!!
- 怎么将字符串数组转为整数型数组
- 追加TABLE的默认属性
- 我想连接sql server网络服务器,可是服务器所在的ip地址PING不通,是哪里的问题,是不是我要另外安装什么软件才可以PING通?
- 如何将远程数据库备份到本地(ms sql server2000)
- 高分询问在哪里能下载免费的 sql server odbc for aix 驱动程序!!!!!
- 版主,请教SQL 2005 Express客户端连接
- SELECT FROM WHERE IN (),能有多强?如何写出高效易读的T-SQL?
--------
a
学习梁哥
a
1.如果在2000下,没有在索引页中增加非键值列一说,因此,最好的方法,创建一聚集索引,同时在name上增加一个索引,使用indexs seek +book 查找方式,我认为是最快的,(引用的字段过多,不宜做复合索引).然而当该表的name字段存在重复值,且重复的记录数/总数值*100>60%.个人认为indexs+book的IO开销与clustered scan的开销应该是差不多的.
所以在2000下,该题无合适答案.
2.在2005下,
A好像是最好的,但如果仍存在I/0开销严重的话,即存在大量的重复值的,就算做了include.查询结果未必就快了.