Tagged articles

N+1

3 articles · Page 1 of 1
21CTO
21CTO
Jul 12, 2026 · Backend Development

How a JPQL JOIN FETCH Query Turned 11,000 Records into 50 Million Rows in Hibernate

A batch‑import of 15,000 templates caused a JPQL query with two JOIN FETCH collections to explode into 50 million rows, triggering out‑of‑memory crashes; the article explains why this happens, how the issue was diagnosed, and three concrete fixes that cut rows by nine‑fold and speed up processing fifteen‑fold.

BatchSizeHibernateJOIN FETCH
0 likes · 10 min read
How a JPQL JOIN FETCH Query Turned 11,000 Records into 50 Million Rows in Hibernate
LuTiao Programming
LuTiao Programming
Feb 25, 2026 · Backend Development

Which Entity‑to‑DTO Mapping Is Fastest? Benchmark of 3 Approaches

By benchmarking manual mapping, MapStruct, and JPQL projection across simple and relational scenarios, the article shows that JPQL is slightly faster in raw tests, but the real performance impact stems from N+1 queries, making query strategy the key factor rather than the mapping technique itself.

DTOEntity MappingN+1
0 likes · 8 min read
Which Entity‑to‑DTO Mapping Is Fastest? Benchmark of 3 Approaches
Su San Talks Tech
Su San Talks Tech
Dec 30, 2025 · Backend Development

How I Cut Category Tree Load Time from 3 Seconds to 30 Milliseconds

A real‑world performance disaster caused by N+1 queries in a SpringBoot project was solved by replacing recursive database calls with a single batch query, building an in‑memory hash map, and adding multi‑level caching, achieving a 100× speedup and dramatically reducing system load.

AlgorithmN+1Optimization
0 likes · 19 min read
How I Cut Category Tree Load Time from 3 Seconds to 30 Milliseconds