Select Star Over-Fetch (ARCH7066)
Esta página aún no está disponible en tu idioma.
Key php.orm.select-star-over-fetch · Severity info · Category orm
Fetching a full entity/all columns when only a few fields are used downstream needlessly inflates row width and serialization cost. A projection (select, pluck) fetches only the needed fields.
Incorrect
Section titled “Incorrect”<?php$names = User::all()->map(fn($u) => $u->name); // all columns fetchedCorrect
Section titled “Correct”<?php$names = User::pluck('name'); // only the name columnUse a projection (select/pluck) that selects only the fields you use.