Grokking Spring Boot
0% completed
The N+1 Query Problem
Venue staff open a page that lists every booking for the Evening Concert, with the seat label and the customer's email on each line. With SQL logging on, the first lines of the log looked like this.
Hibernate: select b1_0.id,b1_0.created_at,b1_0.customer_id,b1_0.price_in_cents,b1_0.seat_id,b1_0.status from booking b1_0 left join seat s1_0 on s1_0.id=b1_0.seat_id left join event e1_0 on e1_0.id=s1_0.event_id where e1_0.id=? Hibernate: select s1_0.id,s1_0.event_id,s1_0.label,s1_0.version from seat s1_0 where s1_0.id=? Hibernate: select c1_0.id,c1_0.email,c1_0.password_hash,c1_0
.....
.....
.....
Like the course? Get enrolled and start learning!
Reading Progress
0%