本文介绍了索引视图和Nhibernate-NOEXPAND提示?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以配置NHibernate在对索引视图执行select语句时发出NOEXPAND提示?除非使用提示,否则SQL Server在执行查询时始终会跳过视图并直接进入基表.
Is it possible to configure NHibernate to issue the NOEXPAND hint when it executes a select statement against an indexed view? SQL Server always skips the views and goes straight to the base tables when executing queries unless the hint is used.
推荐答案
这是我尝试过的一种方法,它确实起作用.刚刚在(table)名称中添加了(NOEXPAND).
Here is a hack I tried and it worked. Just added (NOEXPAND) to the "table" name.
<class name="ClassName" mutable="false" table="vw_ViewName (NOEXPAND)">
...
</class>
这篇关于索引视图和Nhibernate-NOEXPAND提示?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!