3 ms·
N+1 problems were the primary bottleneck in a Websphere backendi worked on for years. Transactions were being aggregated with thousands to 10s of thousands of
by aeonik 2y ago
N+1 problems were the primary bottleneck in a Websphere backendi worked on for years.
Transactions were being aggregated with thousands to 10s of thousands of SQL statements like this.
SELECT * from customer
where id = <single id>
The developers had no idea the ORM was doing this under the hood.
It's trivially easy to say that if every SQL statement took 1ms to execute, that thousands of round trips can really start to tank whatever process it might be blocking.
- dventimi 2y ago> It's trivially easy to say that if every SQL statement took 1ms to execute Good thing I don't say that! What I do say is that the number of SQL calls will tend to scale with the volume of data retrieved. Limit the volume of data the user even is allowed to request and you'll naturally limit the extent of the N+1 problem.