Mysql 查询性能。哪个最好?

标签 mysql sql performance mysql5

您好,我想知道哪种查询适用于多个表。

例如:

select table1.id, table1.name from table1,table2,table3 
where table1.id=table2.id and table2.id=table3.id

select table1.id, table1.name  
from table1 
inner join table2 on table1.id=table2.id 
inner join table3 on table2.id=table3.id 
where 1

select table1.id, table1.name 
from table1 
join table2 on table1.id=table2.id 
join table3 on table2.id=table3.id 
where 1

哪种查询最适合性能?

最佳答案

它们应该是完全一样的。可能您可能想阅读 corresponding section来自 MySQL 手册(然而,这仅与语法有关,与性能无关)。

关于Mysql 查询性能。哪个最好?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7686190/

相关文章:

php - 第一行不是来自 php 中的数据库

mysql - SQL 元相关查询

c# - 如何在 C# 和 C++ 中测量耗时

performance - 初始化或预分配的最佳实践 - MATLAB

mysql - 类型错误 : Cannot read property '_pool' of undefined

php - Codeigniter 在 mysql 中插入 true 作为 0

php - php中的简单注册页面

php - HTML 表的并行 MySQL 查询 - WHILE(x 或 y)?

c# - 如何加速 C# 中的数组克隆?

php - 扩展php注册系统