microsoft / azuredatastudio

Azure Data Studio is a data management and development tool with connectivity to popular cloud and on-premises databases. Azure Data Studio supports Windows, macOS, and Linux, with immediate capability to connect to Azure SQL and SQL Server. Browse the extension library for more database support options including MySQL, PostgreSQL, and MongoDB.
https://learn.microsoft.com/sql/azure-data-studio
MIT License
7.56k stars 899 forks source link

It takes too long to get a TOP 1000 query editor window to come up #3612

Open twright-msft opened 5 years ago

twright-msft commented 5 years ago

Issue Type: Performance Issue

Right click on a table and choose Select Top 1000. It should be very quick to get the query editor window up with Top 1000 query in it. Should be < 1 second like SSMS and other DB admin tools. Right now, at least on my mac, it takes 5+ seconds.

Azure Data Studio version: Azure Data Studio 1.3.7-insider (5adcabc8dea4232bca4a46da445fbfc4b85703f3, 2018-12-08T02:18:11.293Z) OS version: Darwin x64 18.2.0

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz (8 x 2200)| |GPU Status|2d_canvas: enabled
checker_imaging: disabled_off
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: enabled
rasterization: enabled
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled| |Load (avg)|2, 3, 3| |Memory (System)|16.00GB (0.33GB free)| |Process Argv|/Applications/Azure Data Studio.app/Contents/MacOS/Electron| |Screen Reader|no| |VM|0%|
Workspace Info ``` | Window (SQL Server - master instance — sql-big-data-cluster) | Folder (sql-big-data-cluster): 53 files | File types: sql(18) md(14) DS_Store(4) sh(3) err(3) ipynb(3) cmd(2) | ctl(2) py(1) yaml(1) | Conf files:; ```
Extensions (9) Extension|Author (truncated)|Version ---|---|--- vscode-sanddance|dan|0.0.1 newdatabase|kev|0.0.3 ssmskeymap|kev|1.0.0 agent|Mic|0.35.1 import|Mic|0.4.2 profiler|Mic|0.5.1 server-report|Mic|0.1.3 sql-vnext|Mic|0.9.1 whoisactive|Mic|0.1.1
alanrenmsft commented 5 years ago

@twright-msft Is this a recent regression?

anthonydresser commented 5 years ago

Tangentially, in some cases we are faster than SSMS. This seems to be server specific

kburtram commented 5 years ago

This seems like a nice scenario for a perf test. I manually tested against my local server on Windows and the query editor was popping up ~1 sec, which seemed fast enough. But on other platforms & servers I've seen this take quite a while (~5-10 seconds).

The variable time in the scenario is querying the server to get the table's column definitions. Probably that code path could be optimized.

gregveres commented 4 years ago

You guys are thinking about this wrong. The tab needs to come up instantly before the query for the columns returns. Then put a spinning cursor in the tab while the query is being sent to the database. The user needs immediate feedback that the command to start the query was accepted by the system before going off to do some operation that has a random amount of time.

By all means, improve the performance of the query. But change the UI so that the tap pops up immediately. It's just good UX design to give immediate feedback.