All jobs / Database administrator / Performance

Database administrator interview question · 1–3 years

The order-history page issues one query per line item, and some customers have thousands.

The database shows thousands of identical tiny queries per page load. What is happening and what do you suggest?

The strongest answer

An ORM loads a parent then one query per child — N+1; the fix is eager loading or a join so a page is a few queries, and I show developers the log as proof

Why it works

Exactly — round trips are the cost; collapse them, and bring evidence to the developers.

What a good answer covers

Answers that fall short

Who gets asked this

More Performance questions