GroupInfo.group_id = A.group_id and
group_name = 'team1' and
U.record_id = A.record_id and
U.dev_id = A.dev_id and 
U.account_id = A.account_id;以上字段全部加索引

解决方案 »

  1.   

    GroupInfo.group_id = A.group_id and
    group_name = 'team1' and
    U.record_id = A.record_id and
    U.dev_id = A.dev_id and 
    U.account_id = A.account_id;
    对你用到的这几个字段加上索引即可.
      

  2.   

    U.record_id = A.record_id and 
    U.dev_id = A.dev_id and 
    U.account_id = A.account_id;
    我建的索引 对这些动态匹配条件 好像没有什么效果啊?
      

  3.   

    我用的是mysql,没那工具
      

  4.   

    GroupInfo
    group_id,group_name 建立联合索引A
    group_id,record_id,dev_id,account_id 建立联合索引U
    record_id,dev_id,account_id 建联合索引然后看看执行计划
      

  5.   

    GroupInfo.group_id 聚集
    U.record_id,U.dev_id,覆盖索引
    A.group_id 聚集
    试试
      

  6.   

    少了个<U.account_id >
    U.record_id,U.dev_id,U.account_id 覆盖索引
      

  7.   

    谢谢,不过我用的是mysql,没有聚集索引