附加外部数据库速度 [英] Attach External Database Speed

查看:95
本文介绍了附加外部数据库速度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我第一次看LightSwitch并附加到我的SQL Server数据库。 据报道,附加到外部数据库的速度很慢,但是在Beta 2中已经解决了这个问题吗? 到目前为止,它已经在我的
机器上运行了大约45分钟。 如果答案是否定,那很好,我可以等。 我只关心它是否特定于我。 以下是FWIW的一些细节:

I'm taking my first look at LightSwitch and I have attached to my SQL Server database.  Attaching to an external database has been reported as slow before, but has speed been addressed in Beta 2?  It has been running for about 45 minutes on my machine so far.  If the answer is No, that's fine, I can wait.  I'm only concerned if it is something specific to me.  Here are a few details FWIW:


  • 我在Windows XP Mode VM中运行LightSwitch。
  • SQLServer.exe正在使用大部分CPU。
  • 我将MDF复制到VM并附加到VS内的数据库(因为SSMS没有安装LS)。
  • 数据库大约540MB,有88个表。
  • 我的桌子都没有主键(还有)。  LS警告我,但继续前进。

谢谢,

Joel

推荐答案

你好,Joel,

Hi Joel,

B2应该有性能改进,但说实话,我还没有注意到了,但这可能是因为我的机器和我还没有做过许多记录。我仍然在将我的B1应用程序移植到B2。

There are supposed to have been performance improvements in B2, but to be honest, I haven't noticed any yet, but that may be because of my machine & I haven't worked mith many records yet either. I'm still in the process of porting my B1 app to B2.

在VM中工作可能比直接在机器上工作要慢一些,很大程度上取决于你的速度有多快硬盘驱动器是。

Working in a VM is likely to be slower than working on a machine directly, a lot will depend on how fast your hard drive is.

除非你想直接使用db(进行架构更改,输入数据),否则不需要在SSMS中附加数据库以便能够在LS中使用它。直接等)。确保如果对数据库架构进行了任何更改,则右键单击LS&中的
数据源。选择"刷新数据源"所以LS知道这些变化。它不会自动发生。

There's no need to attach the db in SSMS to be able to work with it in LS, unless you want to work with the db directly (making schema changes, entereing data directly etc). Make sure that if you make any changes to your db schema, that you right-click the data source in LS & select "Refresh Data Source" so that LS knows about the changes. It won't happen automatically.

我认为你会发现没有主键,你的数据不会在LS中编辑。因此,除非您只想要只读数据,否则我强烈建议您添加一个自动递增的整数作为每个表的主键(除非您有其他类型的主键需要
),但不要离开没有主键的桌子,你只会让生活更加困难。

I think you're going to find that with no primary keys, your data is not going to be editable in LS. So unless you only want read-only data, I strongly suggest that you add an auto-incrementing integer as the primary key for each table (unless you have reason for some other kind of primary key), but don't leave tables without primary keys, you'll just make your life more difficult.

LS也无法做任何"智能跨越"。没有主键(想想在一个db命中加载更多数据,而不是每个相关表一次命中(实际上,如果你有任何相关的表,没有主键,我想这是不可能的。)这是一个
方法他们我曾经试图加快数据访问速度。

LS also won't be able to do any "smart spanning" without primary keys (think loading more data in one db hit, instead of one hit per related tables (actually, IF you have any related tables, without primary keys, I guess that's not possible). This is one method they've used to try to speed data access up with.

据我所知,B2之后的速度提升了很多,但我们还没有机会看到其中任何一个。

From what I've heard, more speed improvements have been made post-B2, but we haven't had a chance to see any of that yet.

祝LS好运,希望你玩得开心!

Good luck with LS & hope you have fun!

Yann

这篇关于附加外部数据库速度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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