如何在 SQL Server 中使用左外连接对视图进行索引

发布于 2024-12-16 21:50:15 字数 147 浏览 3 评论 0原文

我创建了一个在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

赴月观长安 2024-12-23 21:50:15

这是一篇描述使用 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文