我想知道是否存在一般共识,对于以下情况,两个简单的查询是否比带有连接的单个更复杂的查询好:
SELECT id FROM users WHERE name = 'jon doe' LIMIT 1
// result: 1
SELECT * FROM comments WHERE user_id = 1
vs。
SELECT comments.* FROM comments
JOIN users ON users.id= t1.user_id
WHERE users.name = 'jon doe'