n-plus-one

Installation
SKILL.md

N+1 Query Problem

When to use

  • The user wants to decide between eager loading a relation (with/fetch join), batching IDs into an IN (...), or a single JOIN to collapse N+1 queries.
  • The user sees a query-count profiler (Debugbar, Telescope, Clockwork) reporting hundreds of near-identical SELECTs on one request.
  • The user loops over a collection of records and accesses a related model inside the loop, firing a separate query for each row.

When NOT to use

Installs
1
GitHub Stars
3
First Seen
Jul 3, 2026
n-plus-one — anyorgname/php-skills