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;以上字段全部加索引
group_name = 'team1' and
U.record_id = A.record_id and
U.dev_id = A.dev_id and
U.account_id = A.account_id;以上字段全部加索引
group_name = 'team1' and
U.record_id = A.record_id and
U.dev_id = A.dev_id and
U.account_id = A.account_id;
对你用到的这几个字段加上索引即可.
U.dev_id = A.dev_id and
U.account_id = A.account_id;
我建的索引 对这些动态匹配条件 好像没有什么效果啊?
group_id,group_name 建立联合索引A
group_id,record_id,dev_id,account_id 建立联合索引U
record_id,dev_id,account_id 建联合索引然后看看执行计划
U.record_id,U.dev_id,覆盖索引
A.group_id 聚集
试试
U.record_id,U.dev_id,U.account_id 覆盖索引