Performance · Data access · Product experience
Measured result
Cutting a data-heavy page from 45 seconds to 3
I improved a slow, data-heavy product page by removing N+1 queries and moving sorting and pagination to the server: 45 seconds down to 3, about 93% faster.
Context
The page loaded enough data to make everyday use frustrating and slow. Query patterns multiplied database work, while sorting and pagination happened too late in the request path.
My role
I traced the delay to the data access path, removed N+1 queries, fetched only the fields and records the page needed, and moved sorting and pagination to the server.
Key decisions
- Measure the user-visible delay, then identify query behavior rather than hiding it with a longer timeout.
- Return only the data the page needs and page it at the server so work stays bounded.
- Keep the page behavior while reducing database round trips and payload size.
Outcome
Page load time fell from 45 seconds to 3 seconds, approximately a 93% reduction. I later applied the same query and caching discipline to high-volume reporting APIs, which became about 40% faster.