数据创建索引视图

数据创建索引视图

本文介绍了是否可以在 Sql Server 2008 中从 Xml 数据创建索引视图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从 2005 文档 中看到您无法创建来自 Xml 列的索引视图.

I see from the 2005 documentation that you cannot create an indexed view from an Xml column.

这在 2008 或 2008R2 中可能吗?我找不到任何说明它已添加的文档,但我正在寻求确认,目前我无法方便地访问 2008 环境.

Is this possible in 2008 or 2008R2? I can't find any documentation saying that it is something that was added but am looking for confirmation and I don't have handy access to a 2008 environment at the moment.

编辑

这背后的动机是 Xml 的数量不断增长,以至于 SSRS 报告从 Xml 聚合数据的速度变得越来越慢.

My motivation behind this is that the amount of Xml is growing to the point where SSRS reports which aggregate data from the Xml are becoming slow.

推荐答案

我不相信这是可能的.如果没有更好地解释您要做什么,我可以提供的一个建议是在插入之前将 XML 分开(可能使用而不是触发器,或者在应用程序层执行此粉碎)并存储您的部分想用于单独的非 XML 列中的索引视图.

I don't believe this is possible. Without a better explanation of what you are trying to do, one suggestion I can offer is to pull the XML apart before insert (perhaps using an instead of trigger, or doing this shredding at the application layer) and storing the part(s) you want to use for the indexed view in separate non-XML columns.

这篇关于是否可以在 Sql Server 2008 中从 Xml 数据创建索引视图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-13 21:36