A major performance regression from when you upgraded 5.2.2 to 7.1.1
维护者通常 2 天内回复
评估
这个 Issue 还没有评估数据。
描述
Describe the bug
A major performance regression from when you upgraded 5.2.2 to 7.1.1.
We have a service that bulk loads data from files to hundreds of tables across hundreds of databases as a core part of our operation.
Since the upgrade to 7.1.1 our CPU usage went up 20% and the leading statements running against our DB (based off of Query Store and sys.dm_exec_request) are:
35% of all CPU usage on the server:
SELECT @Column_Names = COALESCE(@Column_Names + '', '', '''') + QUOTENAME([name]) FROM .[sys].[all_columns] WHERE [object_id] = @Object_ID AND COALESCE([graph_type], 0) NOT IN (1, 3, 4, 6, 7) ORDER BY [column_id] ASC
11% of all CPU usage on the server:
IF EXISTS (SELECT TOP 1 * FROM .[sys].[all_columns] WHERE [object_id] = OBJECT_ID($) AND [name] = $)
4% of all CPU usage on the server:
SELECT [Canonical_Column_Name], [Aliased_Column_Name]
FROM #Column_Aliases
ORDER BY [Canonical_Column_Id] ASC
To reproduce
This is our data loading code fragment
using (SqlBulkCopy bc = new SqlBulkCopy(connectionString, SqlBulkCopyOptions.CheckConstraints | SqlBulkCopyOptions.FireTriggers))
{
foreach (DataColumn col in dt.Columns)
{
bc.ColumnMappings.Add(col.ColumnName.ToUpper(), col.ColumnName.ToUpper());
}
bc.DestinationTableName = TableName;
bc.BulkCopyTimeout = 0;
bc.WriteToServer(dt);
bc.Close();
}
Further technical details
Microsoft.Data.SqlClient version: 7.1.1
.NET target: .NET 10
SQL Server version: SQL 2025 CU 9
Operating system: mcr.microsoft.com/dotnet/aspnet:10.0
- 主要语言
- C#
- 星标
- 1k
- 派生
- 352
- 平均合并
- 4 天 8 小时
- 30 天内合并 PR
- 104
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
dotnet/SqlClient 的其他 Issue
-
Sync ExecuteReader on an STA thread deadlocks against a StateChange handler that marshals to the UI thread (OpenAsyncRetry path)可能重新可做 @mdaigle 于 48 天前认领,目前没有进行中的 PR。 未关闭External :link:
难度 2/5 1-3 小时 新手友好度 64/100
dotnet/SqlClient#4534 · 2 条评论 · 已指派 1 人 ·
维护者通常 2 天内回复
-
Area\Tests
难度 2/5 1-3 小时 新手友好度 68/100
dotnet/SqlClient#4377 · 2 条评论 ·
维护者通常 2 天内回复
-
Server error tokens are lost when SQL Server aborts the connection before the driver has posted its read (bare transport error instead of the server's error)可能已有人在做 @poizan42 于 2 天前认领。 未关闭
难度 4/5 3-5 天 新手友好度 25/100
dotnet/SqlClient#4994 · 1 条评论 ·
维护者通常 2 天内回复
-
SqlTransaction.Dispose() throws NullReferenceException from SqlInternalTransaction.Rollback() when it races the background close of a broken connection可能已有人在做 @MaceWindu 于 2 天前认领。 未关闭
dotnet/SqlClient#4971 · 2 条评论 · 已指派 1 人 ·
维护者通常 2 天内回复
-
Suspected: async MARS command can lose its own fatal error, and sync MARS Read waits for CommandTimeout, after another session tears down the connection (managed SNI)可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭Triage Needed :new:
难度 4/5 3-5 天 新手友好度 15/100
维护者通常 2 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 77/100
BEagle1984/silverback#280 ·
-
难度 2/5 1-3 小时 新手友好度 63/100
-
Playground selection bar: comes back after Apply or scrolling while focus is in the Markdown pane未关闭
难度 2/5 1-3 小时 新手友好度 82/100
sillsdev/SIL.TextEditing#175 ·
维护者通常 1 天内回复
-
needs attention untriaged
难度 2/5 1-3 小时 新手友好度 78/100
AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet#3666 ·
维护者通常 3 天内回复
-
难度 2/5 1-3 小时 新手友好度 73/100
MicrosoftLearning/eShopOnWeb#466 ·