An abstraction can hide complexity, but it cannot erase the system underneath. An ORM may let you write queries without SQL; database limits and query costs still show through. section 8.3.2
Watch for leaks when ORM behavior meets database constraints:
- A broad lookup can fetch every column. If each user row includes a 5MB profile image, fetching 100 users can use 500MB. Project only the fields you need. section 8.3.2
- A custom C# function may not translate to SQL. Older ORMs could fetch the whole table and filter in memory; EF Core 3+ throws an exception instead. Rewrite the query in translatable logic, or fetch only necessary data before calculating in memory. section 8.3.2
Figure 8.7 The N+1 Problem: Fetching data in a loop is like making a separate trip to the kitchen for every single french fry. Always fetch in batches!

The N+1 analogy makes the cost of fetching data in a loop tangible: batch requests instead of making a separate trip for each item. section 8.3.2



