ORM(特别是NHibernate的)性能复杂查询 [英] ORM (esp. NHibernate) performance for complex queries

查看:135
本文介绍了ORM(特别是NHibernate的)性能复杂查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我公司是改写从无到有现有应用程序的过程。此应用程序,以及其他任务,执行复杂的SQL查询订单和发票数据,以产生销售报告。查询动态编译取决于哪个标准由用户选择的,因此它们可以是pretty的复杂,如果许多标准来选择。目前,性能又不错,但不是很大。

My company is in the process of rewriting an existing application from scratch. This application, among other tasks, performs complex SQL queries against order and invoice data to produce sales reports. The queries are built dynamically depending on which criteria are selected by the user, so they can be pretty complex if many criteria are selected. Currently, performance is decent, but not great.

现在,新版本中,我们想使用ORM,可能是NHibernate的,因为它显然是支持Oracle精简版是唯一一个(应用程序使用的是Oracle或Oracle精简版,这取决于它是否在连接或断开连接模式下运行)。但我很担心由NHibernate的生成的查询性能。我已经与(LINQ到SQL,实体框架)先于其他的ORM的工作,但查询是pretty的简单,所以不存在性能问题。

Now, for the new version, we would like to use an ORM, probably NHibernate because it's apparently the only one that supports Oracle Lite (the application uses either Oracle or Oracle Lite, depending on whether it's running in connected or disconnected mode). But I'm worried about the performance of queries generated by NHibernate. I've worked with other ORMs before (Linq to SQL, Entity Framework), but the queries were pretty simple, so there was no performance issue.

所以,在我拿一个关于使用ORM或住在普通的SQL的决定,我想知道这些工具如何处理方案,如外部连接,子查询,等等......你觉得一个ORM(尤其是NHibernate的)是适用于上述报告的情况下使用?我应该担心的复杂查询的性能?

So, before I take a decision about using an ORM or staying with plain SQL, I'd like to know how well these tools handle scenarios such as outer joins, subqueries, etc... Do you think an ORM (especially NHibernate) is suitable for use in the reporting scenario described above ? Should I worry about performance for complex queries ?

任何反馈将不胜AP preciated

Any feedback would be greatly appreciated

推荐答案

请参阅这个图表。没有DataObjects.Net现在,但其在比较的EF和NHibernate结果示这里

See this chart. There is no DataObjects.Net for now, but its results in comparison to EF and NHibernate are shown here.

LINQ测试$ C $下EF是的此处;其它版本的工具,可以在同一个文件夹中找到。通过一个T4模板,所以测试是完全一致的。模型中有罗斯文。

LINQ test code for EF is here; versions for other tools can be found in the same folder. All these .cs files are generated by a single T4 template, so tests are fully identical. Model used there is Northwind.

很少有更多的链接:

  • LINQ test description
  • FAQs.

这篇关于ORM(特别是NHibernate的)性能复杂查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆