Skip to content

RU · in the original language

N+1 запросов в Laravel: как один foreach превращается в 101 SELECT и как это запретить

Photo: Хабр

Страница со списком из 100 постов на проде тормозит, а в профайлере — сотня одинаковых лёгких запросов. Это N+1: разбираем, как Eloquent создаёт его через ленивую загрузку, как лечить через with() и w…

Хабр Russia · 31 October 2026

This is an extract. The full article is on Хабр.

Read at the source

Full text, translation and AI summary — after signing in

  • The full article in your language
  • AI summary and translation from the original
  • The same account works in the Suviy app

Free.

Comments

Sign in to join the conversation. Sign in

No comments yet.