Nhibernate添加查询选项 [英] Nhibernate add Option for queries
本文介绍了Nhibernate添加查询选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我最近在Nhibernate生成的SQL中遇到了性能问题,如
I have recently had performance problem with Nhibernate generated SQL as described in
我还找到了一个链接,描述了
I also found a link describing similar experience from the one and only Jeff Atwood at
http://legeronline.blogspot .ca/2009/03/evils-of-slow-paramaterized-query-plans.html
是否有人知道是否可以向Nhibernate添加优化未知"选项?
Does anyone know if there is anyway to add an "Optimize Uknown" option to Nhibernate?
推荐答案
- 您可以考虑扩展MsSqlDialect或
- 使用IConnectionProvider注入自己的commandwrapper,当调用
ExecuteReader()
时会添加提示 - you could look into extending the MsSqlDialect or
- implement IConnectionProvider to inject your own commandwrapper which adds the hint when
ExecuteReader()
is called
这篇关于Nhibernate添加查询选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文