Benjamin Crozat avatar

Benjamin Crozat

@benjamincrozat

N+1 database queries are the #1 killer in most Laravel projects.

Have you heard about Model::automaticallyEagerLoadRelationships()?

It can make a big difference.

On my blog's homepage:
→ Without: 38 queries (~24ms)
→ With: 13 queries (~8ms)
Obviously, in a production environment, with heavy tables and substantial traffic, the benefits compound and it's even more impressive.
Condividi
Esplora

TweetCloner

TweetCloner è uno strumento creativo per X/Twitter che ti consente di clonare qualsiasi tweet o thread, tradurlo e remixarlo in nuovi contenuti e ripubblicarlo in pochi secondi.

© 2024 TweetCloner Tutti i diritti riservati.