3 ms·
I do find it surprising that the results were identical. Having said that, my experience is that over low-latency connections N+1 selects are not as bad as they
by jsight 14y ago
I do find it surprising that the results were identical. Having said that, my experience is that over low-latency connections N+1 selects are not as bad as they are often represented to be. I've occasionally chosen to accept an N+1 for a 5 row list of search results vs. "optimizing" to a JOIN for exactly this reason. Depending on the query plan, search limits, sort parameters, etc, the performance differences can be fairly non-intuitive.
I don't think this explains your case, though, where N=20k. I'm not sure what could have been going on there.