如何在 SQL Server 中使用左外连接对视图进行索引
我创建了一个在 SQL Server 中使用 LEFT OUTER JOIN 的视图。
我无法对视图建立索引,因为您无法将 Index
放在具有 OUTER JOIN
的视图上。
还有其他选择吗?
I have created a view which is using LEFT OUTER JOIN
in SQL Server.
I am unable to index the views because you cannot put an Index
on a view with an OUTER JOIN
.
Any alternatives?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是一篇描述使用
ISNULL(table_id, 0)
创建具有外连接影响的 INNER JOIN 的文章。它可能对你有用。这篇文章中的例子很好,应该是不言自明的。
indexedViewsWithOuterJoins
Here is an article describing the use of
ISNULL(table_id, 0)
to create an INNER JOIN with the affect of an outer join. It may be of use to you.The example in this article is good, should be fairly self-explanatory.
indexedViewsWithOuterJoins