LINQ到SQL(CE)速度与SQLCE [英] LINQ to SQL (CE) speed versus SqlCe

查看:234
本文介绍了LINQ到SQL(CE)速度与SQLCE的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在做这将分析已存储到SQL CE数据库的实时数据的应用程序。当我测试应用程序,因为它是现在建成,使用LINQ到SQL,我得到见效慢,我需要重新考虑如何做到这一点。

I'm making an application that will analyze real-time data that has been stored to a SQL CE database. When I test the application as it is built now, with LINQ to SQL, I get slow results and I need to rethink how to do this.

要救我一些时间,我相信L2S是一样快的'老'SQLCE methodes人?我喜欢L2S并将preFER陪着它,如果你的经验说,它的速度是任何其他数据库连接,我就放心了,我会不会增加通过重写L2S到旧的SQL语句的性能。

To save me some time, can I trust that L2S is just as fast as the 'old' SqlCe methodes were? I like L2S and would prefer to stay with it, and if your experience says it's as fast as any other db connection, I can rest assured that I wouldn't increase performance by rewriting the L2S to old SQL statements.

推荐答案

使用SQLCE时,瓶颈不从产生的LINQ到SQL中的SQL干。请记住,CE是一个过程分贝,因此有它的局限性。例如,左OUTTER联接是一场灾难,无论你用什么来查询它。插入和更新的不坏,但话又说回来,如果你会做一个高容量的任一者的,你会遭受一些严重的性能问题。我的观点是,是缓慢的LINQ不是因为到SQL。我已经基准它在过去的(不知道是不是我仍然有code)和从我记得,LINQ到SQL不慢,然后直接使用ADO.NET查询它。性能问题是由于CE本身的限制。

The bottlenecks when using SqlCE doesn't stem from the SQL generated from Linq to Sql. Remember, CE is an in process db and therefore has it's limitations. For example, LEFT OUTTER JOINS are a DISASTER regardless of what you use to query it. Inserts and Updates aren't bad, but then again, if you'll be doing a high volume of either one of those, you'll suffer some serious performance issues. My point is, the slowness isn't because of LINQ to SQL. I've benchmarked it in the past (don't know if I still have that code) and from what I remember, Linq to SQL wasn't slower then querying it directly with ADO.NET. The performance issues are due to the constraints of CE itself.

这篇关于LINQ到SQL(CE)速度与SQLCE的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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