Table update on PK and another field in MySQL is sporadically slow
问题 This is interesting case where UPDATE in MySQL is sporadically slow. Background: 48GB Innodb buffer cache, 512MB ib logs. Innodb table with 40mln rows. Structure and indexes: CREATE TABLE `VisitorCompetition` ( `VisitorCompetitionId` bigint(20) NOT NULL AUTO_INCREMENT, `UserId` bigint(20) NOT NULL, `CompetitionInstanceId` bigint(20) NOT NULL, `Score` bigint(20) NOT NULL DEFAULT '0', `Visits` bigint(20) DEFAULT NULL, `Status` varchar(255) NOT NULL, `RankAtCompletion` int(11) DEFAULT NULL,