SELECT * FROM test_youtube Y
LEFT JOIN test_youtubelike L ON youtubelike_videoId = youtube_videoId
LEFT JOIN test_youtubeview V ON youtubeview_videoId = youtube_videoId
GROUP BY Y.id
Showing rows 0 - 29 ( 714 total, Query took 0.0062 sec)
SELECT * FROM test_youtube Y
LEFT JOIN test_youtubeview V ON youtubeview_videoId = youtube_videoId
LEFT JOIN test_youtubelike L ON youtubelike_videoId = youtube_videoId
GROUP BY Y.id
Showing rows 0 - 29 ( 714 total, Query took 0.0169 sec)
上述查询的唯一区别是左连接序列(L first,V after vs V first L later)。我认为既然两者都是独立的左连接,那么首先完成左连接就不重要了。但是,查询的速度差别很大。有什么见解吗?