0

I have 2 queries that give me the same result set. I'm trying to choose which method is better and fastest...

QUERY #1

DESCRIBE SELECT *
FROM recording r
JOIN (
    SELECT r.work_id
    FROM recording r
    WHERE r.recording_id = 252
) t1 ON t1.work_id = r.work_id

QUERY #2

DESCRIBE SELECT *
FROM recording r
JOIN recording r2 ON r2.work_id = r.work_id

Is there an advantage choosing one method over the other ? Thanks

Marco
  • 2,687
  • 7
  • 45
  • 61
  • First one should be slower because you are doing a JOIN plus you have a subquery – The One and Only ChemistryBlob Aug 17 '16 at 20:58
  • The queries are not equivalent as the latter is missing the where clause limiting to recording_id = 252, so either your example is missing a part or it's just a fluke that you get the same result. – jpw Aug 17 '16 at 21:01
  • Please post the results of the two [`DESCRIBE`](http://dev.mysql.com/doc/refman/5.7/en/explain.html) statements. They contain the answer you need. – axiac Aug 17 '16 at 21:03

0 Answers0