创建连接 2 个表的查询时。我想到了 2 种可能的方法来编写查询。下面是一个简化的例子。你能告诉我哪个会更快吗?
SELECT t1.a,
t2.a
FROM table1 t1
JOIN table2 t2
ON t1.b = t2.b
WHERE t2.c = 'test'
或者
SELECT t1.a,
t2.a
FROM table1 t1
JOIN (SELECT a, b
FROM table2
WHERE c = 'test') t2
ON t1.b = t2.b