azuredatastudio: azdata-LanguageService is causing huge delays in query execution

I’m connecting to my SQL Server located in the UK from Australia (ping around 300ms). When I’m running any query (even very simple one) I sometimes need to wait for up to a minute to see the result. Steps:

  1. Hit Run

  2. Messages window is emty (no “Started executing…” message yet). But I can see “Executing query” in the footer)

  3. In SQL Server profiler I can see the following queries from azdata-LanguageService app:

exec sp_executesql N'select c.definition,convert(bit,OBJECTPROPERTY(c.object_id,N''ExecIsQuotedIdentOn'')) from [UK001P].sys.sql_modules c where c.object_id = @_msparam_0',N'@_msparam_0 nvarchar(4000)',@_msparam_0=N'296296761'

or

exec sp_executesql N'SELECT
CAST(ISNULL(ic.seed_value,0) AS bigint) AS [IdentitySeed]
FROM
sys.tables AS tbl
INNER JOIN sys.all_columns AS clmns ON clmns.object_id=tbl.object_id
LEFT OUTER JOIN sys.identity_columns AS ic ON ic.object_id = clmns.object_id and ic.column_id = clmns.column_id
WHERE
(clmns.name=@_msparam_0)and((tbl.name=@_msparam_1 and SCHEMA_NAME(tbl.schema_id)=@_msparam_2))
OPTION (FORCE ORDER)
',N'@_msparam_0 nvarchar(4000),@_msparam_1 nvarchar(4000),@_msparam_2 nvarchar(4000)',@_msparam_0=N'Parameter_Id',@_msparam_1=N'bit_CubeGetParameter_SSAS',@_msparam_2=N'dbo'

and others

  1. Only after all those queries have been run I can see “Started executing …” in the messages window and get the output dataset shortly.

It seems to me that Intellisense is just getting the list of all DB object it can find in my query editor and fetches for metadata. And because the server is far it’s actually a gap of 2 seconds between the calls.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 15 (6 by maintainers)

Most upvoted comments

Wonderful, I’ve been using the insiders version 1.45.0 all day today and the improvement detected is impressive, I’ll keep testing

I have been using the stable version 1.44.1 and the Bug has been fixed, wonderful

@romanovmv thanks for providing the profiling details. The language service queries should be executed asynchronously with the SQL Script queries. We’ll double-check to make sure there isn’t some unexpected blocking between these two components.