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