Performance: Query interface basics
MEDIUM IMPACT
This affects how quickly the database queries run and how fast the page loads data from the database.
User.where(active: true)
User.all.select { |u| u.active? }| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Loading all records then filtering in Ruby | N/A | N/A | Blocks rendering due to slow data fetch | [X] Bad |
| Filtering records in database query | N/A | N/A | Faster data fetch enables quicker rendering | [OK] Good |