# n-plus-one

Published articles for n-plus-one.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## How ORM N+1 Queries Create Hidden Request Latency

DevFeed: [How ORM N+1 Queries Create Hidden Request Latency](<https://devfeed.tech/articles/your-orm-issued-400-queries-and-the-p99-looked-fine-until-it-didn-t-39588.md>)

Original publisher: [Read original article](<https://ankit-rana.com/logs/36-orm-n-plus-one-queries-hidden-latency/>)

Author: hello@ankit-rana.com

Published: 2026-08-02T00:00:00Z

Content type: tutorial

Language: en

Sources: [Ankit Rana | Mechanical Sympathy](<https://devfeed.tech/sources/ankit-rana-mechanical-sympathy.md>)

Topics: [Object-relational mapping](<https://devfeed.tech/topics/orm.md>), [Latency](<https://devfeed.tech/topics/latency.md>), [Monitoring](<https://devfeed.tech/topics/monitoring.md>), [lazy loading](<https://devfeed.tech/topics/lazy-loading.md>), [Database](<https://devfeed.tech/topics/database.md>), [connection pool](<https://devfeed.tech/topics/connection-pool.md>)

Tags: [connection-pool](<https://devfeed.tech/tags/connection-pool.md>), [database](<https://devfeed.tech/tags/database.md>), [database-performance](<https://devfeed.tech/tags/database-performance.md>), [hibernate](<https://devfeed.tech/tags/hibernate.md>), [latency](<https://devfeed.tech/tags/latency.md>), [lazy-loading](<https://devfeed.tech/tags/lazy-loading.md>), [monitoring](<https://devfeed.tech/tags/monitoring.md>), [n-plus-one](<https://devfeed.tech/tags/n-plus-one.md>), [observability](<https://devfeed.tech/tags/observability.md>), [orm](<https://devfeed.tech/tags/orm.md>), [query](<https://devfeed.tech/tags/query.md>), [request](<https://devfeed.tech/tags/request.md>)

### AI overview

This article explains how ORM lazy loading can turn a loop over orders into an N+1 query pattern. Individual queries may remain fast and avoid slow-query alerts, while the accumulated network round trips increase request latency and hold connection-pool resources. It recommends monitoring queries per request and asserting query counts in tests.

### Source excerpt

N+1 queries hide from monitoring because no individual query is slow. Four hundred queries at 0.4ms each never appear in the slow query log, never move p99 query latency, and still cost the request 300ms because the expense is the round trip rather than the execution. The metric that catches it is queries per request, and the only durable fix is asserting on that count in tests, since the code that causes it looks like a field access rather than I/O.