Tagged articles

JOIN FETCH

1 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