This question already has answers here:
Explicit vs implicit SQL joins (12 answers)
Closed 4 days ago.
Which of the below SQL queries is more performant, and why?
SELECT <columns>
FROM Dealer, DealerContact
WHERE Dealer.ID = DealerContact.DealerID
SELECT <columns>
FROM Dealer d
JOIN DealerContact dc on d.ID = dc.DealerID
2条答案
按热度按时间z9smfwbn1#
As far as I know, it's basically the same. Because the DBMS transforms all queries to improve their speed. The execution of the result would be the same.
py49o6xq2#
By default
FROM Dealer, DealerContact
will do aCROSS JOIN
that is exponentialy performance consuming. When you don't need to do aCROSS JOIN
, don't do it.It will be better for both performance and code quality to use
[INNER] JOIN
in your case.You could have a look at Microsoft documentation for further information.