Sequel Pro(MySQL)执行连接查询(6000 * 5,000,000)

时间:2016-08-31 13:36:10

标签: mysql performance join time sequelpro

我在MySQL(Sequel Pro)(6000 * 5,000,000)上执行了一个简单的连接查询,但它看起来无穷无尽,并且会永远运行。超过12个小时后,我取消了它。

create table westhamp_to_all_12449_crude_1
select rods_od_12449_crude_1.*, 12449_peak_extended.* from rods_od_12449_crude_1
inner join 12449_peak_extended
on rods_od_12449_crude_1.id=12449_peak_extended.prestigeid;

我发现该表已生成。表是对的吗?如果不对,为什么要生成一个?

由于

1 个答案:

答案 0 :(得分:0)

If you are using Engine=MyISAM, the table is generated as it goes. It is possibly incomplete.

If you are using Engine=InnoDB, I think (but am not sure) that it would not exist.

Please provide EXPLAIN select rods_od_12449_crude_1.*, 12449_peak_extended.* from rods_od_12449_crude_1 inner join 12449_peak_extended on rods_od_12449_crude_1.id=12449_peak_extended.prestigeid; so we can discuss the details.

Also, provide SHOW CREATE TABLE so we can check that you have an adequate index for that JOIN.