表结构:
CREATE TABLE summary
(
id
bigint(20) NOT NULL AUTO_INCREMENT,
empName
varchar(100) DEFAULT NULL,
empUuid
varchar(100) DEFAULT NULL,
deptUuid
varchar(100) DEFAULT NULL,
deptName
varchar(100) DEFAULT NULL,
positionUuid
varchar(100) DEFAULT NULL,
positionName
varchar(100) DEFAULT NULL,
empGroupUuid
varchar(100) DEFAULT NULL,
empGroupName
varchar(100) DEFAULT NULL,
versionUuid
varchar(100) DEFAULT NULL,
companyUuid
varchar(100) DEFAULT NULL,
companyName
varchar(100) DEFAULT NULL’,
strokeScore
decimal(19,2) DEFAULT NULL,
achieveScore
decimal(19,2) DEFAULT NULL,
attendScore
decimal(19,2) DEFAULT NULL,
customScore
decimal(19,2) DEFAULT NULL,
noReachScore
decimal(19,2) DEFAULT NULL,
totalScore
decimal(19,2) DEFAULT NULL,
assessDateScore
decimal(19,2) DEFAULT NULL,
assessWeekScore
decimal(19,2) DEFAULT NULL,
assessMonthScore
decimal(19,2) DEFAULT NULL,
cal_dt
varchar(50) DEFAULT NULL,
approveScore
decimal(19,2) DEFAULT NULL,
PRIMARY KEY (id
) /*T![clustered_index] CLUSTERED */,
KEY idx_companyUuid
(companyUuid
),
KEY idx_empUuid
(empUuid
),
KEY idx_deptUuid
(deptUuid
),
KEY idx_positionUuid
(positionUuid
),
KEY idx_empGroupUuid
(empGroupUuid
),
KEY idx_versionUuid
(versionUuid
),
KEY idx_cal_dt
(cal_dt
)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
添加索引语句:
ALTER TABLE summary ADD INDEX idx_cal_dt_companyuuid (cal_dt,companyUuid);
现在的表现是:row_count前350w左右跑的很快,然后涨到480w左右很长时间不动,然后涨到557w左右很长时间又不动了(此时已经过去2天了),感觉再花个几天也能加完