When Does N+1 Break a System? A Preregistered Measurement of Query-Pattern Performance-Degradation Boundaries
Object-relational mapping (ORM) frameworks let developers model relations as navigable associations or plain identifier references. The folklore that per-row N+1 access is slow is clear, but the practical question, under what conditions and by how much each strategy becomes risky, remains quantitatively unanswered. We report a preregistered measurement study that treats round-trip time (RTT), result-set size, IN-list size, and arrival rate as controlled variables, and maps the performance-degradation threshold surface rather than declaring a single winner. Hypotheses and decision formulas were frozen by commit hash before measurement, and the analysis was mechanized. On a reproducible single-host harness with 12.4M rows, explicit IN-batch stays within 2.5 RTT of JOIN, whereas N+1 enters connection-pool saturation once RTT reaches cross-zone values. A single Hibernate property (default_batch_fetch_size) moves the N+1 path into a flat-latency band without code changes, but only when the batch size is at least the number of distinct references per request. This record contains both the English manuscript (primary) and the Korean manuscript of the same study.
Authors
- Hyundoo Park
- Byungho Choi
Institutions
- Dynetics (United States) (US)
Publication Details
- Journal
- Zenodo (CERN European Organization for Nuclear Research)
- Published
- 2026-07-26
- DOI
- https://doi.org/10.5281/zenodo.21598519
- Primary Topic
- Advanced Data Storage Technologies
- Type
- preprint