A major performance regression from when you upgraded 5.2.2 to 7.1.1

Đang mở
#4,985 3 bình luận 0 reaction 1 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

@cheenamalhotra đang làm issue này rồi.

Từ ngày 4/11/2026.

  • #4988 của @cheenamalhotra — đang mở

Đánh giá

Issue này chưa được đánh giá.

Mô tả

Performance :chart_with_upwards_trend: Regression :boom:
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

Ngôn ngữ chính
C#
Star
1k
Fork
352
Merge trung bình
3 ngày 21 giờ
Pull request đã merge (30 ngày)
112

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của dotnet/SqlClient

Tất cả issue của dotnet/SqlClient

Issue tương tự

Thêm issue về C#

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.