Skip to content

Slow Insert on Tables with Trigger when using BulkInsertAsync  #600

@CallMePepi

Description

@CallMePepi

I use Kafka as datasource and insert the messages 1:1 into an MSSQL DB. The target tables each have a trigger, which updates only 2 columns during the insert (sysUser, sysTime).
What I have noticed is that the insert into the target table with the trigger switched on is much slower than if switched off. As a test, I wrote an insert loop in SSMS with 100,000 inserts into the target table. Once with enabled and once with disabled trigger. The processing time was almost the same in both cases (with trigger 3min 15sec, without trigger 3min 10sec).

I use BulkInsertAsync or SingleInsertAsync-Method for inserting the Data into DB.

Further technical details

  • EF version: .net 8
  • EF Extensions version: 8.103.1
  • Database Server version: [SQL Server 2017]

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions