Performance: Where clauses
MEDIUM IMPACT
Where clauses affect database query speed and the time it takes to fetch data, impacting page load and interaction responsiveness.
$users = DB::table('users')->where('status', 'active')->get();
$users = DB::table('users')->get()->where('status', 'active');
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Filtering after fetching all data | N/A | N/A | High due to slow data arrival | [X] Bad |
| Filtering in database query with where clause | N/A | N/A | Low due to fast data arrival | [OK] Good |