两个左连接太慢,需要分解

时间:2014-10-20 23:01:00

标签: mysql left-join

我有三个表有两个左连接,描述符,概念和术语,它需要太长时间才能完成查询(冻结) 表描述符:19081行; 3个字段:ui,类和名称

表概念34167行; 6个字段:ui,name,preferred_concept,scope_note,umls_ui,descriptor_ui

表项207961行; 7个字段:ui,name,lexical_tag,preferred_tag,permuted_term,print_flag,record_preferred_term,concept_ui

查询如下:

 SELECT d.ui as descUI, 
        d.name as descName, 
        c.name as conceptName, 
        t.name as termName  
 FROM `dataaccess`.`descriptor` as d 
        LEFT JOIN `dataaccess`.`concept` as c ON d.ui =  c.descriptor_ui 
        LEFT JOIN `dataaccess`.`term` as t ON c.ui = t.concept_ui ";

0 个答案:

没有答案