SQL Server CE 4.0实体框架,查询运行速度真的很慢(与SQL Server CE 3.5相比) [英] SQL Server CE 4.0 Entity Framework, query runs realy slow (compared with SQL Server CE 3.5)

查看:129
本文介绍了SQL Server CE 4.0实体框架,查询运行速度真的很慢(与SQL Server CE 3.5相比)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Entity Framework查询C#、. NET 4.0中的小型企业Winforms应用程序。

I'm writing a small business Winforms application in C#, .NET 4.0, using Entity Framework to query database.

我使用SQL Server CE 3.5作为数据库并且这个特定的查询(完全相同)执行得非常快(无法测量,但我没有发现任何延迟)。然后,我切换到SQL Server CE 4.0,并在同一查询上对其进行了测试,大约需要4秒钟才能执行。

I used SQL Server CE 3.5 as my database and this specific (exactly the same) query executed really fast (didn't measure it, but I didn't notice any delay). Then I switched to SQL Server CE 4.0 and I tested it on the same query and it needed around 4 seconds to execute.

我做错了什么还是SQL Server CE?不是要在Winforms中使用4.0,还是...?

Am I doing something wrong or maybe SQL Server CE 4.0 wasn't meant to be used in Winforms, or...?

我应该切换回SQL Server CE 3.5吗?

Should I just switch back to SQL Server CE 3.5?

谢谢您的回答和时间。

编辑:

我的模型是非常基础,因为我还处于开发初期。

My model is very basic, as I am quite early in the development phase.

我的查询绝对简单:

ObjectQuery<Location> locationsQuery = mainDBContext.Locations;

该表还包含10条以下的记录。

Also the table holds under 10 records.

推荐答案

似乎在我使用SQL CE 4.0的地方,这是我的第一个查询,这就是为什么要花这么长时间的原因。

It seems that where I use SQL CE 4.0, this was my first query, which is why it took so much time.

嗯,好吧,当您写到自己的问题时,似乎对您有所帮助。

Ah, well, when you write about your problem it seems to help you.

/我很ham愧

这篇关于SQL Server CE 4.0实体框架,查询运行速度真的很慢(与SQL Server CE 3.5相比)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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