Tagged articles
3 articles
Page 1 of 1
php Courses
php Courses
Sep 15, 2025 · Databases

Eliminate the N+1 Query Anti‑Pattern: Strategies to Boost Database Performance

This article explains why executing many small database queries in a short time harms performance, shows how to detect the N+1 problem with monitoring and logs, and presents refactoring techniques such as eager loading, batch operations, aggregation, caching, and hand‑crafted SQL to dramatically improve speed, scalability, and code quality.

Database PerformanceN+1 QuerySQL Optimization
0 likes · 9 min read
Eliminate the N+1 Query Anti‑Pattern: Strategies to Boost Database Performance
Laravel Tech Community
Laravel Tech Community
Jun 13, 2020 · Backend Development

Understanding Eager Loading in Laravel Eloquent

This article explains Laravel Eloquent's eager loading techniques, demonstrating how to replace lazy-loaded N+1 queries with the with() method, preload multiple or nested relationships, select specific columns, apply constraints, and use lazy eager loading methods like load and loadMissing, all illustrated with PHP code examples.

BackendEloquentLaravel
0 likes · 6 min read
Understanding Eager Loading in Laravel Eloquent