Tagged articles
N+1 Query
10 articles · Page 1 of 1
A legacy PHP 7.2 project with 8.2s average response time was optimized to 1.4s in two weeks through seven fundamental fixes: enabling OPcache, eliminating N+1 queries via eager loading, adding composite database indexes, implementing Redis caching layers, setting HTTP timeouts for external calls, right-sizing PHP-FPM workers, and separating API middleware from web routes.
LaravelN+1 QueryOPcache
0 likes · 12 min read

This article analyzes eight common API performance bottlenecks in Spring Boot applications, including N+1 queries, improper entity returns, missing indexes, JOIN FETCH pagination issues, in-memory filtering, deep pagination, long transactions, and caching strategies, with code examples and optimization techniques for each.
API performanceCachingDTO Projection
0 likes · 14 min read

This guide covers root-cause analysis of N+1 queries in JPA and MyBatis, APM-based detection methods, fetch strategy optimization using EntityGraph and JOIN FETCH, MyBatis resultMap refactoring, lazy-loading boundaries, second-level cache trade-offs, keyset pagination, and production-grade SQL interceptors with code review checklists.
Fetch StrategyJPAMyBatis
0 likes · 21 min read

The article explains that the classic N+1 query anti‑pattern, harmful on client‑server databases like MySQL, is irrelevant for SQLite because its embedded architecture eliminates network round‑trips, turning hundreds of queries into cheap function calls, and examines the performance data and trade‑offs behind this claim.
Database PerformanceFossilN+1 Query
0 likes · 29 min read

The article identifies seven common performance killers in Spring Boot production—N+1 queries, unbounded thread pools, excessive logging, oversized response bodies, missing indexes, synchronous external API calls, and serial API invocations—and provides concrete code‑level solutions such as eager fetching, custom thread pools, lazy logging, DTOs, index creation, timeout configuration, and CompletableFuture parallelism.
CompletableFutureDTON+1 Query
0 likes · 10 min read

Spring Boot’s default Open Session in View (OSIV) keeps Hibernate sessions open throughout the request, silently triggering lazy‑loaded queries during JSON serialization, leading to N+1 problems and massive DB load under load, but disabling it and using explicit fetch joins restores performance.
HibernateJPAN+1 Query
0 likes · 7 min read

The article explains what Open Session in View (OSIV) is, why keeping a Hibernate Session open for the whole request can silently cause massive N+1 query problems in Spring Boot REST APIs, and provides a concrete example and step‑by‑step solution using explicit fetch joins and disabling OSIV.
HibernateJPAN+1 Query
0 likes · 8 min read

This article analyzes a severe N+1 query performance disaster in a Java Spring Boot project, explains why the traditional recursive approach is slow, and presents a production‑tested solution that reduces database calls to one, uses O(n) tree construction, and adds multi‑level caching to achieve a 100‑fold speedup.
Java backendN+1 QuerySpring Cache
0 likes · 24 min read

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.
Batch OperationsCachingDatabase Performance
0 likes · 9 min read

This article explains the N+1 query performance issue, demonstrates a naïve Python/SQLite implementation that triggers N+1 queries, compares its runtime, and then shows how using SQL JOINs, GROUP BY, and nested data structures can dramatically improve query efficiency and reduce latency.
JOINN+1 QuerySQL
0 likes · 9 min read
