为什么Visual Studio中的SQL Server对象资源管理器这么慢?

时间:2022-04-30 02:42:46

I just created a new SQL Server Database in Azure and then opened it in Visual Studio 2015 using the link in the Azure Portal. I had to add my IP to the firewall but otherwise the process went smoothly.

我刚刚在Azure中创建了一个新的SQL Server数据库,然后使用Azure门户中的链接在Visual Studio 2015中打开它。我不得不将我的IP添加到防火墙,但其他过程进展顺利。

However, when I am trying to interact with the database server via SQL Server Object Explorer it is painfully slow. Expanding any of the folders in my Database (e.g., Tables folder) takes 10 to 30 seconds. The database is brand new, so the only things it has are whatever Azure creates when it instantiates a new DB.

但是,当我尝试通过SQL Server对象资源管理器与数据库服务器进行交互时,速度非常慢。扩展我的数据库中的任何文件夹(例如,Tables文件夹)需要10到30秒。数据库是全新的,因此它唯一拥有的是Azure在实例化新数据库时创建的内容。

This is the second Azure DB I have created and tried to view in Visual Studio and both have the same problem. With the first one I thought maybe I did something wrong during setup but this time I made sure to do everything by the book.

这是我创建并尝试在Visual Studio中查看的第二个Azure数据库,两者都有相同的问题。有了第一个,我想也许我在设置过程中做错了什么,但这次我确保按照这本书做了一切。

Running actual queries against the DB from within Visual Studio (right click the DB, New Query ..., select * from INFORMATION_SCHEMA.TABLES;) is very fast, so it doesn't appear to be a problem with my connection to Azure.

从Visual Studio中对数据库运行实际查询(右键单击数据库,新查询...,从INFORMATION_SCHEMA.TABLES中选择*)非常快,因此我与Azure的连接似乎没有问题。

Why is it so painfully slow? What can I do to make it faster?

为什么这么痛苦?我该怎么做才能让它更快?

I am using Visual Studio 2015 Update 1 (14.0.24720.00) on Windows 10 (fully patched) and during database creation I checked the box to use the latest version.

我在Windows 10上使用Visual Studio 2015 Update 1(14.0.24720.00)(完全修补),在数据库创建期间,我选中了框以使用最新版本。

1 个解决方案

#1


8  

SQL Server Object Explorer (SSDT) in Visual Studio builds a schema model of entire database when you connect a database first time. This is a concept of model based database development which provides benefits such as validating scripts against database without needing to modify the live database etc. When it comes to Azure SQL DB where the resource is limited with your database's pricing tier, the performance of executing queries to fetch database model can vary. Based on our performance tests, pricing tiers above S1/S2 provides a similar interactivity as local or on-prem SQL instance.

第一次连接数据库时,Visual Studio中的SQL Server对象资源管理器(SSDT)构建整个数据库的模式模型。这是基于模型的数据库开发的概念,它提供诸如针对数据库验证脚本而不需要修改实时数据库等的好处。当涉及资源受限于数据库定价层的Azure SQL DB时,执行查询的性能获取数据库模型可能会有所不同。根据我们的性能测试,S1 / S2之上的定价层提供了与本地或本地SQL实例类似的交互性。

More in details, current SSDT's mechanism is to composite minimum number of queries to minimize the number of round-trip operations with SQL server/database hence each query execution time is longer. It affects the interactivity of SQL Server Object Explorer while the query is being executed.

更详细地说,当前SSDT的机制是组合最小数量的查询以最小化SQL服务器/数据库的往返操作的数量,因此每个查询执行时间更长。在执行查询时,它会影响SQL Server对象资源管理器的交互性。

To enhance, SSDT team is revising the design for Azure SQLDB to provide a faster interaction experience while keeping the benefit of model based database development.

为了增强,SSDT团队正在修改Azure SQLDB的设计,以提供更快的交互体验,同时保持基于模型的数据库开发的优势。

Disclosure: I work on the SQL Data Tools team as a PM

披露:我作为PM工作在SQL数据工具团队

#1


8  

SQL Server Object Explorer (SSDT) in Visual Studio builds a schema model of entire database when you connect a database first time. This is a concept of model based database development which provides benefits such as validating scripts against database without needing to modify the live database etc. When it comes to Azure SQL DB where the resource is limited with your database's pricing tier, the performance of executing queries to fetch database model can vary. Based on our performance tests, pricing tiers above S1/S2 provides a similar interactivity as local or on-prem SQL instance.

第一次连接数据库时,Visual Studio中的SQL Server对象资源管理器(SSDT)构建整个数据库的模式模型。这是基于模型的数据库开发的概念,它提供诸如针对数据库验证脚本而不需要修改实时数据库等的好处。当涉及资源受限于数据库定价层的Azure SQL DB时,执行查询的性能获取数据库模型可能会有所不同。根据我们的性能测试,S1 / S2之上的定价层提供了与本地或本地SQL实例类似的交互性。

More in details, current SSDT's mechanism is to composite minimum number of queries to minimize the number of round-trip operations with SQL server/database hence each query execution time is longer. It affects the interactivity of SQL Server Object Explorer while the query is being executed.

更详细地说,当前SSDT的机制是组合最小数量的查询以最小化SQL服务器/数据库的往返操作的数量,因此每个查询执行时间更长。在执行查询时,它会影响SQL Server对象资源管理器的交互性。

To enhance, SSDT team is revising the design for Azure SQLDB to provide a faster interaction experience while keeping the benefit of model based database development.

为了增强,SSDT团队正在修改Azure SQLDB的设计,以提供更快的交互体验,同时保持基于模型的数据库开发的优势。

Disclosure: I work on the SQL Data Tools team as a PM

披露:我作为PM工作在SQL数据工具团队