Mysql Query perfomance. Which one is best?

流过昼夜 提交于 2019-12-06 15:33:42

They should be exactly the same. Probably you might want to read the corresponding section from the MySQL manual (which is only about syntax, not about performance, however).

I would expect all 3 of these to be parsed as exactly equivalent, and will therefore perform identically. The where clauses in the latter two queries are redundant.

Many developers prefer the explicit, ANSI-92 syntax (as used in the latter 2 queries) over the implicit syntax in the first query - however, this should have no impact on performance.

Xavi López says GoFundMonica

As it has already been pointed out, all forms are the same regarding efficiency. They are different, however, in an also very important aspect: readability.

That's why I prefer to use the inner join syntax. It's also the notation prevalent in the standards.

You might find the answers to this question useful: SQL Inner Join syntax

join is just a shortcut for inner join and doing from table1,table2 where is the same as an inner join too (see mysql documentation and mysql forum). they all should be treated the same way by mysql (the parsing-time for the second one might be a tiny bit lower, but thats negligible).

at least you should choose the one thats more radable (and maintainable that way) wich would be the second one (in my opinion, some guys might like the first one).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!