The N+1 problem in an online store admin: one query instead of a thousand

An order overview that slows down as the online store grows usually doesn't suffer from bad page design - it suffers from the wrong number of database queries.

The N+1 problem is one of the most common and easiest to overlook performance errors in administrative interfaces. The name describes exactly what happens: one query loads a list of records (say 100 orders), and then for EACH of them another query is sent for the related data (customer name, order items). The result: 1 + 100 queries instead of one.

Why you can't see it at first glance

With twenty orders in the database the difference is unnoticeable - the page loads in a fraction of a second either way. The problem shows up as the store grows: a thousand orders means a thousand and one queries, and an admin that was fast during development starts to slow down in production with a real volume of data. Without a deliberate test on a large volume of data, this goes unnoticed until the client complains.

The solution: one aggregated query

The order overview on Fotobazoš.cz is built to pull the customer, the items and the order status in one aggregated query - not one query per order. The admin stays fast regardless of whether the store has twenty orders or ten thousand.

Why this decides who can run the website

Fotobazoš.cz is run by its owner, alone, without a technical background. An admin that slows down as orders grow means frustration in daily work and eventually the need to call a developer for something that should have worked on its own. Admin performance isn't a luxury for big companies - it's the condition for a non-technical person to manage an online store without outside help.

Case study

Fotobazoš.cz

View case study →

More articles

How much does your current website cost you?

Send us your website address. Within 24 hours we will get back to you with concrete numbers - what your website is costing you and what can be done about it.

Write to us directly - click to copy the address

business@kypyx.cz

Or book a 15-minute call right away: pick a time.

Or send us your brief

Get in touch.

Tell us what is bothering you - the website, manual work, or both. Within 24 hours we will get back to you with a concrete proposal.

Prefer email? business@kypyx.cz