带有[Column(IsVersion = true)]的Windows Phone 7 Mango Sql CE连接速度慢 [英] Windows Phone 7 Mango Sql CE with [Column(IsVersion = true)] slow with join
问题描述
HI
我一直在开发一个使用本地数据库的Windows Phone 7 Mango应用程序,需要每天更新15个表。使用linq到sql,更新需要7百万(在数据库的表中清空14,000条记录)。所以用户等待不可能是
。我必须找到一种方法来使更新更快。
我已经搜索并找到了Windows Phone 7本地数据库的最佳实践。他们告诉为每个表添加一列获得性能提升
      [专栏(IsVersion = true)]
     私有二进制版本;
结果很好,因为它将更新过程优化到3mn(即使用户仍然无法接受等待)
- -----------------------------------
问题在于此没有添加colomn我的查询运行1-3秒,但是当我添加列时,我的查询占用了2mn :(
任何人都可以帮助我.thx
--------表中空数据的代码
'p>            在VAR查询=从attr_them(Application.Current如APP).db.Attraction_thematics
'p>                       选择attr_them;
(Application.Current as App).db。 Attraction_thematics.DeleteAllOnSubmit(查询);
                      (Application.Current as App).db.SubmitChanges();
---------查询获取数据
            INT item.star_0 =(从(Application.Current如APP).db.Attraction_thematics
&NBSP attr_them;       &NBSP ;         在(Application.Current如APP)加入ATTR上attr_them.attraction_id .db.Attractions等于attr.identifier
                  其中attr_them.thematic_id == item.id&安培;&安培; attr.ma_selection == 1
select attr).Count();
我认为您可以在 $ b中获得更多反馈$ b http://social.msdn.microsoft.com/Forums/en-US/windowsphone7se ries / &或者至少在Windows CE论坛上获取托管代码
http://social.msdn.microsoft.com/Forums/en-US/winembmngdapp/threads
HI
I've been developing an application for Windows Phone 7 Mango that use local database that require daily update with 15 tables. with linq to sql, it take up to 7mn to update ( empty 14,000 records in a table of the database ). so it would not possible for user to wait. that I have to find a way to make the update faster.
I've search and found the best practice of local database for Windows Phone 7. They tell to add a column for each table to get the performance boost
[Column(IsVersion = true)]
private Binary version;
the result was good since it optimize the update process to 3mn ( even still not acceptable by user to wait )
-------------------------------------
the problem is that without adding the colomn my query run 1-3 seconds but when I added the column my query take up to 2mn :(
could anyone help me with it. thx
-------- code for empty data in a table
var query = from attr_them in (Application.Current as App).db.Attraction_thematics
select attr_them;
(Application.Current as App).db.Attraction_thematics.DeleteAllOnSubmit(query);
(Application.Current as App).db.SubmitChanges();
--------- query for getting data
int item.star_0 = (from attr_them in (Application.Current as App).db.Attraction_thematics
join attr in (Application.Current as App).db.Attractions on attr_them.attraction_id equals attr.identifier
where attr_them.thematic_id == item.id && attr.ma_selection == 1
select attr).Count();
I think you can have more feedback in http://social.msdn.microsoft.com/Forums/en-US/windowsphone7series/ or, at least, on the Windows CE forum for managed code http://social.msdn.microsoft.com/Forums/en-US/winembmngdapp/threads
这篇关于带有[Column(IsVersion = true)]的Windows Phone 7 Mango Sql CE连接速度慢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!