I’ve seen people writing the following query
SELECT column_name(s)
FROM table_name1
LEFT JOIN table_name2
ON table_name1.column_name=table_name2.column_name
written like this
SELECT column_name(s)
FROM table_name1
LEFT JOIN table_name2
ON table_name2.column_name =table_name1.column_name
does it actually make any difference?
Not under normal circumstances, no. It’s imaginable that there could be some sufficiently complex query, much more complex than your examples, where the join optimizer would be so overwhelmed that this could matter, but if that’s even possible you’d have to work pretty hard.
You can write both of those as
USING (column_name), by the way. 🙂I’d also recommend, for purposes of DIY analysis of issues like this, that you familiarize yourself with
EXPLAIN.