<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/bulk-delete-with-ef-core-and-dapper-in-net-qyejkyed1" -->

---
title: Bulk Delete with EF Core and Dapper in .NET | daily.dev
description: A performance comparison of bulk delete approaches in .NET using EF Core and Dapper against PostgreSQL. Benchmarks show fetching entities into memory and...
canonical: https://daily.dev/posts/bulk-delete-with-ef-core-and-dapper-in-net-qyejkyed1
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Bulk Delete with EF Core and Dapper in .NET | daily.dev
og:description: A performance comparison of bulk delete approaches in .NET using EF Core and Dapper against PostgreSQL. Benchmarks show fetching entities into memory and...
og:url: https://daily.dev/posts/bulk-delete-with-ef-core-and-dapper-in-net-qyejkyed1
og:image: https://api.daily.dev/og/posts/QyEjKYEd1.png
og:image:alt: Bulk Delete with EF Core and Dapper in .NET
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Bulk Delete with EF Core and Dapper in .NET

**[NikolaTech](https://daily.dev/sources/nikolatech)** · 4 min read · 0 upvotes · 0 comments

## Summary

A performance comparison of bulk delete approaches in .NET using EF Core and Dapper against PostgreSQL. Benchmarks show fetching entities into memory and removing them is extremely slow (80.7ms) compared to raw SQL (3.18ms), Dapper (3.28ms), and EF Core's ExecuteDelete (3.43ms). The piece recommends ExecuteDelete as the cleanest approach with performance nearly matching raw SQL and Dapper, and teases a follow-up post covering third-party bulk operation NuGet packages for even higher performance.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://nikolatech.net/blogs/bulk-delete-ef-core-dapper-dotnet>

## Questions this post answers

### How much faster is EF Core ExecuteDeleteAsync compared to fetching and removing entities in a loop?

ExecuteDeleteAsync is dramatically faster, averaging around 3.4ms versus roughly 80.7ms for fetching 1000 rows into memory with RemoveRange and SaveChangesAsync, based on a BenchmarkDotNet comparison against a PostgreSQL database. ExecuteDeleteAsync runs the delete directly in the database, bypassing the EF Core change tracker, making it nearly 24x faster for bulk deletes.

_Developers tuning EF Core delete performance can compare these patterns and benchmarks on daily.dev._

### Does EF Core ExecuteDeleteAsync wait for SaveChangesAsync to run?

No, ExecuteDeleteAsync executes its SQL immediately against the database and does not wait for SaveChangesAsync to be called. Because of this, if transactional behavior is needed, the delete must be wrapped manually in a transaction using BeginTransactionAsync and CommitAsync rather than relying on the change tracker's save cycle.

_daily.dev helps developers keep up with EF Core execution and transaction behavior changes._

### Is raw SQL faster than Dapper or EF Core ExecuteDelete for bulk deleting rows in PostgreSQL?

Raw SQL is consistently a bit faster, measuring about 3.18ms versus 3.28ms for Dapper and 3.43ms for EF Core's ExecuteDelete in a 1000-row PostgreSQL benchmark. The difference is small enough that ExecuteDelete is considered the cleanest and safest overall choice despite the slight performance gap.

_daily.dev keeps developers choosing between raw SQL, Dapper, and EF Core informed with real benchmarks._

## Similar posts on daily.dev

- [How to Delete and Update Millions of Rows in EF Core Without Loading a Single Entity - Chris Woody Woodruff](https://daily.dev/posts/how-to-delete-and-update-millions-of-rows-in-ef-core-without-loading-a-single-entity---chris-woody-w-axftumts9) · We Are .NET · 0 upvotes · 0 comments
- [Milan Jovanović](https://daily.dev/posts/milan-jovanovi--lmrqyshnk) · Milan Jovanović · 2 upvotes · 0 comments
- [Fastest Way to Bulk Insert Thousands of Rows in EF Core](https://daily.dev/posts/fastest-way-to-bulk-insert-thousands-of-rows-in-ef-core-uym6xxs1m) · Code with Mukesh · 8 upvotes · 2 comments
- [How to Work With Dapper in .Net](https://daily.dev/posts/how-to-work-with-dapper-in-net-yzgrlyllb) · freeCodeCamp · 17 upvotes · 0 comments

---

Tags: [#.net](https://daily.dev/tags/.net), [#postgresql](https://daily.dev/tags/postgresql)

[View this post on daily.dev](https://daily.dev/posts/bulk-delete-with-ef-core-and-dapper-in-net-qyejkyed1)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Bulk Delete with EF Core and Dapper in .NET","url":"https://daily.dev/posts/bulk-delete-with-ef-core-and-dapper-in-net-qyejkyed1","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/bulk-delete-with-ef-core-and-dapper-in-net-qyejkyed1"},"datePublished":"2026-10-04T13:05:57.608Z","dateModified":"2026-10-04T13:13:28.070Z","description":"A performance comparison of bulk delete approaches in .NET using EF Core and Dapper against PostgreSQL. Benchmarks show fetching entities into memory and...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/fd2af65a4b420de3096121f116035fce?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/fd2af65a4b420de3096121f116035fce?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"NikolaTech","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"NikolaTech","logo":"https://media.daily.dev/image/upload/s--1h2fO6FL--/f_auto,q_auto/v1791119050/logos/nikolatech?_a=BAMAMicg0","url":"https://daily.dev/sources/nikolatech"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/bulk-delete-with-ef-core-and-dapper-in-net-qyejkyed1","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":".net,postgresql","timeRequired":"PT4M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"NikolaTech","item":"https://daily.dev/sources/nikolatech"},{"@type":"ListItem","position":3,"name":"Bulk Delete with EF Core and Dapper in .NET"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/bulk-delete-with-ef-core-and-dapper-in-net-qyejkyed1#faq","mainEntity":[{"@type":"Question","name":"How much faster is EF Core ExecuteDeleteAsync compared to fetching and removing entities in a loop?","acceptedAnswer":{"@type":"Answer","text":"ExecuteDeleteAsync is dramatically faster, averaging around 3.4ms versus roughly 80.7ms for fetching 1000 rows into memory with RemoveRange and SaveChangesAsync, based on a BenchmarkDotNet comparison against a PostgreSQL database. ExecuteDeleteAsync runs the delete directly in the database, bypassing the EF Core change tracker, making it nearly 24x faster for bulk deletes. Developers tuning EF Core delete performance can compare these patterns and benchmarks on daily.dev."}},{"@type":"Question","name":"Does EF Core ExecuteDeleteAsync wait for SaveChangesAsync to run?","acceptedAnswer":{"@type":"Answer","text":"No, ExecuteDeleteAsync executes its SQL immediately against the database and does not wait for SaveChangesAsync to be called. Because of this, if transactional behavior is needed, the delete must be wrapped manually in a transaction using BeginTransactionAsync and CommitAsync rather than relying on the change tracker's save cycle. daily.dev helps developers keep up with EF Core execution and transaction behavior changes."}},{"@type":"Question","name":"Is raw SQL faster than Dapper or EF Core ExecuteDelete for bulk deleting rows in PostgreSQL?","acceptedAnswer":{"@type":"Answer","text":"Raw SQL is consistently a bit faster, measuring about 3.18ms versus 3.28ms for Dapper and 3.43ms for EF Core's ExecuteDelete in a 1000-row PostgreSQL benchmark. The difference is small enough that ExecuteDelete is considered the cleanest and safest overall choice despite the slight performance gap. daily.dev keeps developers choosing between raw SQL, Dapper, and EF Core informed with real benchmarks."}}]}
```

