🔢 N+1 Query Visualizer

The N+1 problem is JPA/Hibernate's quietest performance killer: load a list of N rows, then touch a lazy association and it fires one more query per row — 1 + N. Watch it happen, then fix it with JOIN FETCH, @EntityGraph, or batch fetching and see the count collapse.

★ Star on GitHub
orders (N)10 strategy
0
SQL queries fired
0ms
total DB round-trips
vs lazy N+1

  
Try this: run with Lazy and N=10 → 11 queries (1 for the orders + 1 per order's customer). Every extra row is another round-trip; at N=100 that's 101 queries for one page. Switch to JOIN FETCH or @EntityGraph1 query. Batch fetching keeps lazy loading but groups the child selects into WHERE id IN (…) chunks → 1 + ⌈N/5⌉. The killer detail: N+1 doesn't error or even look slow in dev with 5 rows — it quietly explodes in production.