检查自己的sql语句有没有走索引
只需要在最前面加一个 EXPLAIN 即可,
例如:
explain
SELECTcc.id, cc.flow_id AS flowId, cc.meter_code AS meterCode, cc.type, cc.status, cc.exe_count AS exeCount, cc.create_time AS createTime, cc.exe_time AS exeTime, cc.over_time AS overTime
FROM
civil_command AS cc
WHERE
1 = 1
AND
cc.status <> 'EXE_SUCCESS'
ORDER BY
cc.create_time DESC
LIMIT
10000,100000
如果type = all 说明是全表查找,否则...自己查explain详解~