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.
シェア
探索

TweetCloner

TweetClonerは、X/Twitter用のクリエイティブツールで、ツイートやスレッドをクローンし、翻訳して新しいコンテンツにリミックスし、数秒で再公開するのに役立ちます。

© 2024 TweetCloner 全ての権利を保有