microsoft / microsoft/vscode-mssql
[Bug]: A consistent delay of approximately 5 seconds before query execution completes/ change connection completes
- Dominant language
- TypeScript
- Stars
- 1.9k
- Forks
- 610
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 97
Description
### Description
When connecting to the SQL Server and executing queries through vscode-mssql, there is **a consistent delay of approximately 5 seconds** before query execution completes/ change connection completes. This delay occurs even for very simple queries and is reproducible across sessions. The attached log file shows the connection process and query execution timestamps, highlighting the fixed delay.
Additionally, the delay only happens on **the first query execution** after connecting. Subsequent queries run very quickly without noticeable delay.
I have verified that the firewall layer is not applying any filtering rules.
I also tested on another machine running macOS, and the delay does not occur there.
Based on this, my assumption is that the delay may be caused by some process at the my computer OS level or a configuration issue in VS Code / the mssql extension.
I would appreciate any guidance or support from the community to help identify the root cause and possible solutions
### Steps to Reproduce
1. Open VS Code with the vscode-mssql extension installed.
2. Connect to a SQL Server instance
3. Change database context to any database/ server
4. Run a simple query (e.g., SELECT 1).
5. Observe that query execution consistently takes ~5 seconds, as shown in the logs.
### Affected Area
- [x] Connection dialog (SQL Server | Azure browse/Fabric browse)
- [ ] Query editor
- [x] Query results panel
- [ ] Object Explorer
- [ ] GitHub Copilot integration
- [ ] Preview/Edit data
- [ ] Table Designer
- [ ] Schema Designer
- [ ] Schema Compare
- [ ] Local SQL Server Container provisioning
- [ ] SQL database in Fabric provisioning
- [ ] DACPAC/BACPAC export/import
- [ ] SQL Database projects
- [ ] Query Plan Visualizer
- [ ] Other (please describe below)
### If you selected "Other", please describe the affected area
_No response_
### Environment Information
- VS code version: 1.42.0
- Visual Studio Code 1.117
- SQL server
- Window 11
### Confirmation
- [x] I have searched existing issues and couldn't find a match
- [ ] I want to work on this issue
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the first-query delay in VS Code with the vscode-mssql extension against SQL Server, then compare the connection and query execution timestamps in the attached log. Check whether the behavior differs between the reported Windows and macOS environments. Done means identifying the source of the consistent delay and confirming that first-query and connection completion timing no longer show it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- sql, typescript, vscode
- Domain
- database, developer-experience
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 38/100