3 ms·
It really depends though. If you're using mysql with myisam tables you can easily come up with a sequence of events that lead to N+1 records being much faster d
by smokinn 17y ago
It really depends though. If you're using mysql with myisam tables you can easily come up with a sequence of events that lead to N+1 records being much faster due to table locking issues, especially when joins start getting involved. In that case if you can split your query into N+1 requests by primary key and avoid the join that locks both (or worse, many) tables for a little while it'll be much smoother and faster in production.
Now, of course, if you can do that you really should be thinking about memcached and/or a key/value store with possibly a distributed index rather than a relational db anyway.