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 保留所有權利。