优化连接4个表的mysql中的join语句

时间:2014-10-28 05:40:56

标签: mysql query-optimization

如何优化以下查询?运行时间太长了。 主要主表(relev_annot,ranking_pearson,norm_alls,smoothby2)都是16400行(并且具有相同数量的相同标识符)。其他2个表(CClist,bgo_FGH)分别只有35和1800行。

这是我一直在运行的查询:

select relev_annots.*, CClist.corecc_gene, bgo_FGH.*, ranks_pearson.*, norm_alls.*, smoothby2.*
from relev_annots 
join smoothby2 on smoothby2.pt3 = relev_annots.pt3 
join norm_alls on norm_alls.pt3 = relev_annots.pt3
join ranks_pearson ON ranks_pearson.pt3 = relev_annots.pt3
left join CClist on CClist.pt2_kegg_id = relev_annots.pt3_kegg_hit
LEFT JOIN bgo_FGH ON bgo_FGH.pt3 = relev_annots.pt3

感谢。

0 个答案:

没有答案