---
title: "Discussion on \"EF Core N+1 Queries: Why Your API Gets Slower as Data Grows\" | Hashnode"
description: "Discussion on \"EF Core N+1 Queries: Why Your API Gets Slower as Data Grows\". Learn how to detect and fix EF Core N+1 queries, measure database calls, and improve API performance with Include(), Select(), and explicit loading."
url: "https://hashnode.com/posts/ef-core-n-1-queries-why-your-api-gets-slower-as-data-grows/6aa933e83deba08c2d56eb35"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [EF Core N+1 Queries: Why Your API Gets Slower as Data Grows](https://convergesol.hashnode.dev/ef-core-n-1-queries-why-your-api-gets-slower-as-data-grows?utm_source=hashnode&utm_medium=feed)

Learn how to detect and fix EF Core N+1 queries, measure database calls, and improve API performance with Include(), Select(), and explicit loading.

Sep 15 · 11 min read · convergesol.hashnode.dev  
Read the article

-   [#entity-framework-core](https://hashnode.com/tag/entity-framework-core)
-   [#dotnet](https://hashnode.com/tag/dotnet)
-   [#csharp](https://hashnode.com/tag/csharp)
-   [#database](https://hashnode.com/tag/database)
-   [#performance](https://hashnode.com/tag/performance)
-   [#aspnetcore](https://hashnode.com/tag/aspnetcore)
-   [#backend-developments](https://hashnode.com/tag/backend-developments)
-   [#software-engineering](https://hashnode.com/tag/software-engineering)

## Written by

[Converge Solution](https://hashnode.com/@convergesolution)

@convergesolution · New York, USA

  
[View profile](https://hashnode.com/@convergesolution)

Custom Software, AI & Cloud Solutions for Startups and Enterprises

Converge Solution is a software development company delivering AI, cloud, data, product engineering, low-code, Salesforce, and enterprise technology solutions for businesses worldwide.

## Responses 2

Markdown supported · ⌘↵ to post

[Adam Lewis](https://hashnode.com/@nark3d)

[Sep 22](https://hashnode.com/posts/ef-core-n-1-queries-why-your-api-gets-slower-as-data-grows/6aa933e83deba08c2d56eb35/comment/6ab240198766389c2438c64a)

The N+1 problem also hides from a code review because the query that multiplies is rarely the one you are looking at. It comes from lazy loading being on by default, so a navigation property gets touched inside a loop or a serialiser walks a graph you did not know was there. Turning lazy loading off and projecting with Select is hard, and honestly it is the only way I have found to keep this from creeping back in. The functional tests pass either way, which is why this one tends to reach production before anyone notices.

[Converge Solution](https://hashnode.com/@convergesolution)

[Sep 22](https://hashnode.com/posts/ef-core-n-1-queries-why-your-api-gets-slower-as-data-grows/6aa933e83deba08c2d56eb35/comment/6ab240198766389c2438c64a#reply-6ab255771e2f988e1602450e)

Thanks for sharing this!
