如何使用索引视图 [英] How to use indexed view

查看:90
本文介绍了如何使用索引视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



如何在sql中使用索引视图,据说索引视图提高了查询的性能.我们目前正在使用视图,但是检索15000行花费了太多时间.所以请您建议我如何使用索引视图. br/>
感谢

Hi,

How can we use indexed view in sql ,It is said that indexed view improves the performance of query .We are currently using view but its taking too much time to retrieve 15000 rows.So can u please suggest me how to use indexed view.

Thanks

推荐答案

MSDN上有详细信息可为视图建立索引-请参见
Details are available on MSDN to index a view - see http://technet.microsoft.com/en-us/library/cc917715.aspx#XSLTsection127121120120[^].


首先,索引视图仅适用于Enterprise (或开发人员)版的Sql Server.

其次,获取15'000行将需要一些时间,尤其是在视图复杂的情况下.您是否真的需要客户端中的所有这些行,还是可以在服务器端执行一些逻辑来减少要获取的行数.

第三,您是否检查了基础表的索引.特别是它们支持视图中的条件.
First of all indexed view works well only with Enterprise (or Developer) edition of Sql Server.

Secondly, fetching 15''000 rows is going to take some time especially if the view is complex. Do you really need all those rows in the client or is there some logic you could do at server side which would reduce the amount of rows to fetch.

Thirdly, have you checked the indexing of the underlying tables. Especially that they support the conditions in the view.


您应该在此 ^ ]知道要使用索引视图来提高性能.
除了上面的链接,您还可以导航
创建索引视图 [ SQL Server中的索引视图基础 [
you should check out the whole article at this link-[Improving Performance with SQL Server 2005 Indexed Views][^] to know to use Indexed view for improving performance.
In addition to above link you can also navigate
Creating an Indexed View[^]
Indexed Views Basics in SQL Server[^]


这篇关于如何使用索引视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆