~/talk

Common mistakes in EF Core

Talkat NDC Oslo 2023 · 2023-05-22..05-26· [databases]

Benchmarks show specific, fixable mistakes: casting queries to IEnumerable causing full-table downloads can spike memory to 2 GB and turn a 128 ms count into 33 s under load (up to ~260× slower in load tests); using AsNoTracking saves ~4× memory and speeds reads; unnecessary Include calls slow queries (~2.5×) and implicit selects avoid joins; correct server-side pagination yields ~18× faster responses; cancellation tokens halve average latency and prevent machines from becoming unresponsive; EF Core 7 ExecuteUpdate enables single-statement bulk updates.

AI-written summary · about

  1. 0:00Introduction
  2. 3:12Speaker setup
  3. 7:48Benchmark tools overview
  4. 9:58Seven deadly sins
  5. 10:19Casting to IEnumberable
  6. 16:06Ignoring AsNoTracking
  7. 20:58Overusing Include
  8. 23:58Improper pagination
  9. 29:42Forgetting cancellation tokens
  10. 35:31Inefficient updates/deletes
  11. 41:38Honorable mentions
  12. 45:09DB context pooling
  13. 48:24Tagging queries
  14. 50:12AI for query optimization
  15. 56:58Premature optimization
  16. 1:00:07Resources and closing
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.