<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/ef-core-performance-n-1-cartesian-explosion-and-how-to-fix-both-cewuy5iti" -->

---
title: EF Core Performance: N+1, Cartesian Explosion and How to...
description: A practical walkthrough of two major EF Core performance pitfalls: the N+1 query problem and Cartesian explosion. Starting with a demo showing 1,501 SQL...
canonical: https://daily.dev/posts/ef-core-performance-n-1-cartesian-explosion-and-how-to-fix-both-cewuy5iti
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: EF Core Performance: N+1, Cartesian Explosion and How to Fix Both | daily.dev
og:description: A practical walkthrough of two major EF Core performance pitfalls: the N+1 query problem and Cartesian explosion. Starting with a demo showing 1,501 SQL...
og:url: https://daily.dev/posts/ef-core-performance-n-1-cartesian-explosion-and-how-to-fix-both-cewuy5iti
og:image: https://api.daily.dev/og/posts/CeWuY5ItI.png
og:image:alt: EF Core Performance: N+1, Cartesian Explosion and How to Fix Both
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.

# EF Core Performance: N+1, Cartesian Explosion and How to Fix Both

**[We Are .NET](https://daily.dev/sources/wearedotnet)** · 11 min read · 0 upvotes · 0 comments

## Summary

A practical walkthrough of two major EF Core performance pitfalls: the N+1 query problem and Cartesian explosion. Starting with a demo showing 1,501 SQL queries and 7.5-second response times caused by lazy loading, the tutorial covers three approaches to loading related entities: projections (best for scalar/aggregate data, risky with collections), eager loading with Include (causes Cartesian explosion with multiple collections), and split queries using AsSplitQuery() (reduces response from timeout/15s down to ~700ms by issuing separate SQL statements instead of joining everything into one massive result set). Key takeaways: disable lazy loading proxies, use projections for single nav properties and aggregates, and use split queries when loading multiple collection navigations.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.youtube.com/watch?v=iaZxzDmfTHU>

## Similar posts on daily.dev

- [The N\+1 Query Problem in EF Core: Detection, Diagnosis, and Permanent Fixes - Chris Woody Woodruff](https://daily.dev/posts/the-n-1-query-problem-in-ef-core-detection-diagnosis-and-permanent-fixes---chris-woody-woodruff-1wjglh6js) · We Are .NET · 4 upvotes · 0 comments

---

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

[View this post on daily.dev](https://daily.dev/posts/ef-core-performance-n-1-cartesian-explosion-and-how-to-fix-both-cewuy5iti)

```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":"EF Core Performance: N+1, Cartesian Explosion and How to Fix Both","url":"https://daily.dev/posts/ef-core-performance-n-1-cartesian-explosion-and-how-to-fix-both-cewuy5iti","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/ef-core-performance-n-1-cartesian-explosion-and-how-to-fix-both-cewuy5iti"},"datePublished":"2026-03-17T07:37:08.530Z","dateModified":"2026-03-17T07:37:29.356Z","description":"A practical walkthrough of two major EF Core performance pitfalls: the N+1 query problem and Cartesian explosion. Starting with a demo showing 1,501 SQL...","image":"https://i.ytimg.com/vi/iaZxzDmfTHU/sddefault.jpg","thumbnailUrl":"https://i.ytimg.com/vi/iaZxzDmfTHU/sddefault.jpg","isAccessibleForFree":true,"articleSection":"We Are .NET","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":"We Are .NET","logo":"https://media.daily.dev/image/upload/s--BsnVOa3i--/f_auto/v1718347410/logos/wearedotnet","url":"https://daily.dev/sources/wearedotnet"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/ef-core-performance-n-1-cartesian-explosion-and-how-to-fix-both-cewuy5iti","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"performance,.net","timeRequired":"PT11M","video":{"@type":"VideoObject","name":"EF Core Performance: N+1, Cartesian Explosion and How to Fix Both","description":"A practical walkthrough of two major EF Core performance pitfalls: the N+1 query problem and Cartesian explosion. Starting with a demo showing 1,501 SQL...","thumbnailUrl":"https://i.ytimg.com/vi/iaZxzDmfTHU/sddefault.jpg","uploadDate":"2026-03-17T07:37:08.530Z","duration":"PT11M","url":"https://api.daily.dev/r/CeWuY5ItI","embedUrl":"https://www.youtube.com/embed/iaZxzDmfTHU"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"We Are .NET","item":"https://daily.dev/sources/wearedotnet"},{"@type":"ListItem","position":3,"name":"EF Core Performance: N+1, Cartesian Explosion and How to Fix Both"}]}
```

