Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vast difference in runtime between SSMS and Notebook query runtime when including XML data #4359

Open
ConstantineK opened this issue Mar 8, 2019 · 7 comments

Comments

@ConstantineK
Copy link

After reading through the issues, this may be resolved with further movement on #4123 or #4124.

  • Azure Data Studio Version:
    Version: 1.5.1-insider
    Commit: 7344b41
    Date: 2019-03-07T03:38:43.893Z
    VS Code 1.30.1
    Electron: 2.0.12
    Chrome: 61.0.3163.100
    Node.js: 8.9.3
    V8: 6.1.534.41
    OS: Windows_NT x64 10.0.17134

Steps to Reproduce:

  1. Run the following query in both SSMS and ADS (against a local SQL Server instance)
;with f as 
(
	SELECT 
		name, 
		target_name, 
		CAST(xet.target_data AS xml) as target_data
	FROM sys.dm_xe_session_targets AS xet
	JOIN sys.dm_xe_sessions AS xe
	   ON (xe.address = xet.event_session_address)
) 
select *
from f as f1
CROSS JOIN f AS f2
  1. Note the large gap in the runtimes.

In my personal testing, the following query returned 25 rows (5x5) - took 2 seconds in SSMS, and 17 seconds in the Notebook.

When monitoring the behavior via sp_whoisactive, I noted a wait type of ASYNC_NETWORK_IO - this generally indicates the client is having an issue chewing through the result set that the SQL Server is throwing at it, and is having to wait for the client.

When adding a third cross join (CROSS JOIN f AS f3), SSMS returns 125 rows in 10s, and the Notebook took 2 minutes 25s (x12).

@chlafreniere
Copy link
Contributor

Thanks so much for the detailed analysis here! We'll be looking into this soon, as notebook query perf is quite important for us 😄.

@chlafreniere chlafreniere added this to the April Release milestone Mar 9, 2019
@chlafreniere
Copy link
Contributor

@ConstantineK Could you please try running the same query in the query editor in ADS and let us know what the perf numbers look like?

@ConstantineK
Copy link
Author

Sure thing @chlafreniere.

@ConstantineK
Copy link
Author

Ran the query in the normal query editor, it ran in 17s first try and then became quite unresponsive for a significant time before rendering the results.

Subsequent runs return in "8 seconds" but make the client go nuts with regards to CPU usage, even to redraw the screen after resizing.

During this time you can see my CPU usage increase even while the client results are collapsed and really struggles to render the rows when I scroll through them.

2019-03-27_11-18-46

@ConstantineK
Copy link
Author

Watching query execution in sp_whoisactive during the ADS query window results also show ASYNC_NETWORK_IO as the wait type in question, though the unresponsive client "lagginess" was anytime dealing with the results set or redrawing the window, not just the initial query time.

@chlafreniere chlafreniere modified the milestones: April Release, Planning Apr 4, 2019
@chlafreniere chlafreniere modified the milestones: Planning, Backlog Jun 6, 2019
@kevcunnane kevcunnane removed this from the Backlog milestone Jun 6, 2019
@kburtram kburtram added this to the Backlog milestone Jul 1, 2019
@corivera corivera closed this as completed Jan 7, 2020
@yualan yualan reopened this Jan 13, 2020
@yualan
Copy link
Contributor

yualan commented Jan 13, 2020

Hi @corivera, this issue is being actively discussed in this thread: https://twitter.com/vickyharp/status/1216783392487792640

Was this issue closed because it is being tracked elsewhere?

@corivera
Copy link
Member

We bulk closed a lot of older issues. We can revisit this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

9 participants